Python from Wise Guy's Viewpoint

Adam Warner usenet at consulting.net.nz
Thu Oct 23 21:19:27 EDT 2003


Hi Matthias Blume,

> Pascal Costanza <costanza at web.de> writes:
> 
>> Well, to say this once more, there are programs out there that have a
>> consistent design, that don't have "problems", and that cannot be
>> statically checked.
> 
> Care to give an example?

(setf *debugger-hook*
      (lambda (condition value)
        (declare (ignorable condition value))
        (invoke-restart (psychic))))

(defun psychic ()
  (let* ((*read-eval* nil)
         (input (ignore-errors (read))))
    (format t "Input ~S is of type ~S.~%" input (type-of input))))

(loop (psychic))

This can only be statically compiled in the most trivial sense where every
input object type is permissible (i.e. every object is of type T).

Regards,
Adam




More information about the Python-list mailing list