What is Expressiveness in a Computer Language

David Hopwood david.nospam.hopwood at blueyonder.co.uk
Thu Jun 22 18:27:09 EDT 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
inefficient, anyway.

-- 
David Hopwood <david.nospam.hopwood at blueyonder.co.uk>



More information about the Python-list mailing list