[Tutor] Question about classes
alan.gauld at btinternet.com
Sat Aug 25 14:42:15 CEST 2007
"Eric Abrahamsen" <eric at abrahamsen.com> wrote
>> Welcome to the wacky world of recursion.
>> You call __upp from inside __upp so you do indeed generate
>> a new layer, in fact you start a new while loop. You need to
> So all those "yes"s were actually backing out of multiple while
> loops... Should have guessed that calling a method from inside
> was a bad idea.
Actually recursion is a very powerful construction and not at
all a bad idea, but it needs to be carefully controlled - as you
discovered - but I have a topic on it in my tutorial (in the
'advanced' section) if you want to see some of the
things it can be used for.
Author of the Learn to Program web site
More information about the Tutor