[erlang-questions] preferred looping style

Richard O'Keefe <>
Thu Jun 23 04:20:57 CEST 2011


On 23/06/2011, at 5:44 AM, Icarus Alive wrote:

> Hi,
> 
> Of these 2 styles, which one is preferred, and why ?
> To me, the readability of 2nd style is better, tough it consumes 1 stack frame extra.

Why do you say style 2 consumes one stack frame extra?
It's called via a tail call, so that when mainLoop/0
(whyDoYouWantToWriteUglyUnreadableNamesLikeThis?
 DidTheUnderscoreKeyBreakOffYourKeyboardOrWhat?)
is running there isn't any frame for loopInit/0.





More information about the erlang-questions mailing list