What does "first class" mean?

Philip 'Yes, that's my address' Newton nospam.newton at gmx.li
Mon May 1 02:16:50 EDT 2000


On 29 Apr 2000 18:11:27 GMT, kc5tja at garnet.armored.net (Samuel A. Falvo
II) wrote:

>This isn't *strictly* true.  The following code, for x86 processors, returns
>a function that does nothing:

Nope, it returns a pointer to a function. (See also the prototype of the
function: NoOp *foo(void) means 'foo' is a function return 'NoOp *', not
a 'NoOp'. Try writing 'NoOp' as return type and see what your compiler
thinks.)

You can't return functions in C, or have arrays of functions, etc.
Pointers to functions, yes.

Similarly in Perl, you can't pass around functions, only references to
functions (AFAIK).

It's probably the same in Python, only the language doesn't make it
explicit that you're passing around references. You're still passing
around pointers, but it looks as if you're passing around functions.

Cheers,
Philip
-- 
Philip Newton <nospam.newton at gmx.li>
If you're not part of the solution, you're part of the precipitate.



More information about the Python-list mailing list