string to function reference
aleaxit at yahoo.com
Sat Sep 2 15:27:26 CEST 2000
"Michael Hudson" <mwh21 at cam.ac.uk> wrote in message
news:m33djjyo8p.fsf at atrus.jesus.cam.ac.uk...
> You're not missing symbol-function, you're missing find-symbol.
> Python would be a lisp-1 if it were a lisp.
> > (symbol-function "REDUCE")
> *** - SYMBOL-FUNCTION: "REDUCE" is not a symbol
> > (symbol-function (find-symbol "REDUCE"))
> #<SYSTEM-FUNCTION REDUCE>
Otoh, eval('reduce') returns a function-object (which
can be applied directly or through apply). There is no
special datatype 'symbol': the string is mapped
directly to (a reference to) the object it's bound to. Is
it all that different, all in all...?
More information about the Python-list