On Aug 25, 2006, at 12:56 PM, Guyren Howe wrote:
On Aug 25, 2006, at 1:41 PM, Norman Palardy wrote:
This would work if we had first-class classes. But we don't, and
right now, you can't treat a class as an object in this way. The
shared methods and properties make a class *almost* exactly like
a module at the moment.
First class functions seem, to me, to be a characteristic of
certain kinds of languages (mainly scripting languages) and not
fully compiled languages like RB, C and C++.
Java may support first class classes, but this seems to be a
characteristic of the fact that it runs inside a VM and where you
can dynamically create the code for a class, compile it and then
load it into the VM.
Are there examples of compiled languages that support first-class
classes ?
Nothing to do with whether the language is compiled or not, other
than all kinds of things being easier to implement in an
interpreted language.
Popular compiled languages I know of that support first-class
classes are: Java, C#, Perl, Python (the latter two compile to byte-
code engines).
Any that are compiled to machine code languages ?
These all have a VM or are interpreted in some fashion
There are other, less popular ones. In fact, I know of only two OOP
languages that *don't* support first-class classes (or prototypes,
which provides equivalent functionality). C++ actually stands out
for being a popular OOP language without first-class classes.
Right.
There seems to be some kind of relationship between being a language
compiled to machine code and not having first class classes.
Objective C _might_ permit this but I do not have enough experience
with it to say it does.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>