For Programmers: Free Programming Magazines  


Home > Archive > Functional > August 2007 > Re: What's the reason to have non-short-circuit operators in erlang









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: What's the reason to have non-short-circuit operators in erlang
Joachim Durchholz

2007-08-15, 7:11 pm

konryd schrieb:
> I just began reading "Programming Erlang", and wonder what is the
> reason for having both short-circuit and non-short-circuit logical
> "and" and "or" sice they're to be used in guards anyway (which by
> definition don't alter data). While short-circuit logic is obviously
> very practical for cases like division by zero in your example, I
> can't think of any practical use of non-short-circuit operators in
> guards.


A non-short-circuiting operator allows the compiler to choose which
operand to evaluate first.

Regards,
Jo
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com