[Edu-sig] understanding recursion

kirby urner kirby.urner at gmail.com
Tue Feb 20 07:05:08 CET 2007


> The important thing in these exercises is that we can't use our typical arithmetic > operators of +, -, *, /, as we are DEFINING them!

I think a Pythoneer will twistedly think at this point is:  why do you
say "can't use" we can can just *redefine* __add__, __sub__, other
__ribs__, to suit, get whatever meanings for those typical arithmetic
operators you like.

> And in the act of defining them, we naturally have to think recursively, as we
> haven't been given any looping constructs.

But in Python, we have been, given looping constructs (it's a VHLL ya know,
not an assembly language like Scheme and/or MMIX).

Kirby


More information about the Edu-sig mailing list