Python from Wise Guy's Viewpoint
Pascal Costanza
costanza at web.de
Tue Nov 11 04:56:27 EST 2003
Fergus Henderson wrote:
> Suppose the original ML program defines the following functions
>
> foo : int -> int
> bar : string -> string
> ...
>
> We can add dynamic typing like this:
>
> datatype Generic = Int of int
> | String of string
> | Atom of string
> | Cons Generic Generic
> | Apply Generic Generic
> | ...
^^^
How many do you need of those, especially when you want to allow that
type to be extended in the running program?
> Note that our symbol table includes an entry for the function "define",
> so that eval can be used to modify the dynamic bindings.
DEFUN is just one example. What about DEFTYPE, DEFCLASS, DEFPACKAGE, and
so forth...
> The program includes a definition for "eval", and "eval" is an
> interpreter, So in that sense, we have added a new interpreter.
That's the whole point of my argument.
Pascal
--
Pascal Costanza University of Bonn
mailto:costanza at web.de Institute of Computer Science III
http://www.pascalcostanza.de Römerstr. 164, D-53117 Bonn (Germany)
More information about the Python-list
mailing list