Self function

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Thu May 7 18:07:58 CEST 2009


Francis Carr:

I don't know who are you talking to, but I can give you few answers
anyway.

>collections of multiply-recursive functions (which get used very frequently -- by no means is it an uncommon situation, as you suggest in your initial post),<

They may be frequent in Scheme (because it's often used as an almost
pure language), but in Python code they are quite rare. I have used
two mutual recursive functions only once in non-toy Python code in two
or more years.



>Yet -- scheme does not provide out-of-the-box support for your proposed "let-a-function-implicitly- refer-to-itself" idea.  This suggests that the idea itself runs counter to more important aspects of a programming language.<

I see. It's not a very implicit thing, because you have to call a
function anyway, it's just it has a fixed name, like __func__.
I think it doesn't runs counter to Python & D languages (I have asked
for a similar feature in D2 too, and the designers seem to have
accepted the idea, already suggested there by another person in the
past).

Bye,
bearophile



More information about the Python-list mailing list