| 
  | 
On 5/15/2011 21:17, clipka wrote:
> In Java the whole smash is called the Reflection API.
In C# too.
Wow, Java really vamped that up since last I looked.
http://download.oracle.com/javase/7/docs/api/java/lang/Class.html
C# has the "Type" object with similar capabilities. You can even construct 
new code and classes and such using it.
I'm not 100% sure I'm comfortable calling classes first-class objects, given 
the documentation says things like :
"Instances of the class Class represent classes and interfaces in a running 
Java application."
There's similar wording in C#.  It's more like "this type is an interface to 
manipulate classes, which aren't really first-class objects, which is why we 
give you this separate data structure to manipulate them."  It just *feels* 
like they're not first-class objects, compared to Smalltalk or JavaScript or 
something like that.
Of course, if the language provides a type that lets you do all that stuff 
to a class, whether it's "really" a class or not is a pretty meaningless 
question.
-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."
 Post a reply to this message 
 | 
  |