What is Expressiveness in a Computer Language
david.nospam.hopwood at blueyonder.co.uk
Fri Jun 23 00:27:09 CEST 2006
Pascal Bourguignon wrote:
> But it's always possible at run-time that new functions and new
> function calls be generated such as:
> (let ((x "two"))
> (eval `(defmethod g ((self ,(type-of x))) t))
> (eval `(defmethod h ((x ,(type-of x)) (y string))
> (,(intern (format nil "DO-SOMETHING-WITH-A-~A" (type-of x))) x)
> (do-something-with-a-string y)))
> (funcall (compile nil `(let ((x ,x)) (lambda () (f x "Hi!"))))))
> Will you execute the whole type-inference on the whole program "black
> box" everytime you define a new function? Will you recompile all the
> "black box" functions to take into account the new type the arguments
> can be now?
Yes, why not?
> This wouldn't be too efficient.
It's rare, so it doesn't need to be efficient. 'eval' is inherently
David Hopwood <david.nospam.hopwood at blueyonder.co.uk>
More information about the Python-list