Reply to post: Re: Sort in a functional language

At the feet of the Great Monad, or, How the functional programming craze plays out

Ptol

Re: Sort in a functional language

"Congratulations on not understanding the point I was making. I guess you think functional languages use a special functional based CPU rather than the normal one? Never mind."

The magic fairy dust is this: If you structure your function so that the recusive call is the last act of your function, then erlang will reuse the same stack memory, allowing you to write a recusive function to iterate over a very long list without running out of stack space.

Other languages dont tend to do this, as the programmer will have written a loop instead.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon