[erlang-questions] Understanding recursion

Henning Diedrich hd2010@REDACTED
Sat Jun 2 01:47:22 CEST 2012


I second the premise.

But the 0-case is missing. You basically proposed:

     grok(understood) -> ok.

     grok(Prereq) -> grok(Prereq).

Which is a dead loop for Prereq /= understood, as the jokes it inspired 
demonstrate.

There is hope though, I was allowed to hear the sense of wonder first 
hand when a CS student discovered that on machine code level recursions 
really become iterations. I am pretty sure the newest generation of 
programmers have recursion hardwired now, for skipping all the low level 
stuff and starting out with functional languages (not kidding).

Henning

On 5/19/11 2:58 PM, Joe Armstrong wrote:
> I think how we teach recursion is wrong.
>
> Understanding recursion is really easy,
> all you have to do is understand recursion.
>
> /Joe
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120602/005ec925/attachment.htm>


More information about the erlang-questions mailing list