Python from Wise Guy's Viewpoint

Joachim Durchholz joachim.durchholz at web.de
Sat Oct 25 16:58:12 EDT 2003


prunesquallor at comcast.net wrote:
> 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.)

Now *that* is a real challenge, and Haskell indeed doesn't allow this 
(it says "black_hole has an infinite type", which is not a surprise: the 
literal transliteration of the above function would be
   black_hole _ = black_hole
and the only solution to the above equation would require that 
black_hole has a countably infinite number of _ parameters).

However, what purpose would the function serve? I'm pretty sure that 
there's an equivalent idiom in Haskell, but I can't tell unless I know 
what black_hole is good for.

Regards,
Jo





More information about the Python-list mailing list