true

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

true

Donald Steven
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'.


Don

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: true

zxq9-2
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
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: true

Richard O'Keefe
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, <[hidden email]> 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
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: true

Donald Steven

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, <[hidden email]> 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
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions