Python from Wise Guy's Viewpoint

Pascal Costanza costanza at
Tue Nov 11 10:56:27 CET 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 Costanza               University of Bonn
mailto:costanza at        Institute of Computer Science III  Römerstr. 164, D-53117 Bonn (Germany)

More information about the Python-list mailing list