[erlang-questions] true
Donald Steven
t6sn7gt@REDACTED
Sat Mar 30 12:41:38 CET 2019
I didn't know that about other functional languages. As a retiree, I
just program for fun and have done some in Haskell, whence I picked up
'otherwise', which I much prefer.
On 3/30/2019 1:45 AM, Richard O'Keefe wrote:
> 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 <mailto: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 <mailto:erlang-questions@REDACTED>
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
> _______________________________________________
> 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/58a7b6c6/attachment.htm>
More information about the erlang-questions
mailing list