[erlang-questions] Newbie: Is there a short-circuit for the comma operator?

James Cone jcone@REDACTED
Thu Oct 11 08:05:21 CEST 2007


Thanks; I like auxilliary functions as a general technique.  The only 
way it doesn't scale is the shopping-list of command-line arguments, and 
I guess the answer to that is records.

The code also gets simpler when I start using erlang:list_to_integer. 
Should something like that be in the getting-started manual, near 
io:format()?

>> Raimo, I may have miscommunicated; I don't want the returned value; what 
>> > I'm trying to achieve is to be tail-recursive from the middle of an if, 
>> > where the non-recursing branches will evaluate another expression, after 
>> > a comma-operator.  So throw/catch requires that I fail, because the 
>> > stack frame will still be there, to catch the thrown thing.
> 
> In that case the standard solution is to restructure the code,
> create a support function See below.




More information about the erlang-questions mailing list