Origin of the term "first-class object"

Rainer Deyke rainerd at eldwood.com
Mon Nov 17 18:18:52 EST 2003


John Roth wrote:
> For example, in Python both classes and functions are
> objects (there are no second class citizens in Python...)

I would consider variables to be second-class citizens.  You can change
their value, delete them, and get at the object to which they refer, but you
can't do much else with them.

> In Java, neither classes nor methods are first class
> objects, even though you can get a "class" object
> if you ask politely, it's simply a special construct
> for the reflection mechanism.
>
> In C++, neither is an object, first class or not.

While you can't create new functions and unbound methods in C++ at runtime,
you can take their address and pass that around as a first class object.
Bound methods are another matter.


-- 
Rainer Deyke - rainerd at eldwood.com - http://eldwood.com






More information about the Python-list mailing list