Created
May 17, 2011 18:19
-
-
Save DmitrySoshnikov/977034 to your computer and use it in GitHub Desktop.
Classification of classes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // by Dmitry Soshnikov <dmitry.soshnikov@gmail.ru> | |
| // MIT Style License | |
| *Classification of classes:* | |
| ============================================================================= | |
| | Dynamic | Static | |
| ----------------------------------------------------------------------------- | |
| | | | |
| | Coffee, Python, Ruby, | SmallTalk, built-in | |
| First-class | JavaScript (w/o sugar), etc. | classes of Python, etc. | |
| | | | |
| ----------------------------------------------------------------------------- | |
| Second-class | PHP, etc. | Java, C++, etc. | |
| ----------------------------------------------------------------------------- | |
| P.S.: | |
| A *first-class* value -- the value which may participate as normal data. E.g. can be created literally | |
| at runtime, passed as an argument, or returned as a values. | |
| 2. A *second-class* value (or a *first-order* value) -- the value which is not the first-class value. | |
| *Note*, second-class values can be used partially as first-class values, e.g. passed as arguments | |
| (an example -- pointers to functions in C/C++). So the most important difference of a first-class | |
| value is the ability to be created at runtime and in particular cases to be used as objects. | |
| Regarding functions, "first-class-ness" is also related with static scope, i.e. the ability of | |
| functions to be *closures*. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment