[erlang-questions] true
Richard O'Keefe
raoknz@REDACTED
Sat Mar 30 06:45:08 CET 2019
Just for the record, every functional programming
language I know that *has* guards uses true just
the way Erlang does. This actually goes back all
the way to Lisp, where "if" had no "else". You
wrote (COND (g1 b1) ... (gn bn) (T be)), where T
was (and remains) Lisp's version of 'true'.
Clean and Haskell allow 'otherwise' as a synonym
of 'True'. I stick with 'True' because it is
easier for me to understand.
On Fri, 29 Mar 2019 at 03:16, <zxq9@REDACTED> wrote:
> On 2019年3月27日水曜日 18時21分36秒 JST Donald Steven wrote:
> > As someone very new to Erlang, I find it interesting to follow the
> > discussion on guards.
> >
> >
> > FWIW, the *only* thing about Erlang that drives me to distraction is the
> > use of the atom 'true' as a reliable "or, if the above ain't so" default
> > value for the expression. If only (how I wish it were so) the atom
> > wasn't so often completely at odds -- and at times the inverse -- of the
> > normal English 'read' of the if expression. Please consider
> > grandfathering 'true' (not to break old code) and coming up with a
> > logically less committed atom-of-the-future such as 'default' or
> > 'otherwise'.
>
> Use `case` and general matching instead of `if` and other boolean
> constructs
> and your life will be better.
>
> In Erlang boolean comparison constructs apply mostly in *range*
> comparisons,
> not general comparisons. `if` means something *very* different in Erlang
> than you're used to.
>
> -Craig
> _______________________________________________
> 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/20190330/cd2770e7/attachment.htm>
More information about the erlang-questions
mailing list