Python from Wise Guy's Viewpoint

prunesquallor at comcast.net prunesquallor at comcast.net
Sat Oct 25 13:41:25 EDT 2003


Joachim Durchholz <joachim.durchholz at web.de> writes:

> prunesquallor at comcast.net wrote:
>
>> "Marshall Spight" <mspight at dnai.com> writes:
>>
>>>It would be really interesting to see a small but useful example
>>>of a program that will not pass a statically typed language.
>>>It seems to me that how easy it is to generate such programs
>>>will be an interesting metric.
>>
>> Would this count?
>> (defun noisy-apply (f arglist)
>>   (format t "I am now about to apply ~s to ~s" f arglist)
>>   (apply f arglist))
>
> To sum it all up: the above specifications are all intended to say the
> same, namely "noisy_apply is a function that takes an arbitrary
> function, and another parameter that must be of the same type as the
> input parameter for the supplied function, and that will return a
> value of the same type as the supplied function will return".
> Modern static type systems can express such types :-)

Are they happy with something like this?

(defun black-hole (x)
  #'black-hole)

(for non lispers, the funny #' is a namespace operator.
 The black-hole function gobbles an argument and returns
 the black-hole function.)





More information about the Python-list mailing list