[erlang-questions] Order of evaluation of guards

Anthony Ramine n.oxyde@REDACTED
Wed Jan 7 00:44:35 CET 2015

Le 6 janv. 2015 à 20:02, Robert Virding <rvirding@REDACTED> a écrit :

> I think it is very important to stress that the guard and the body of a clause are very different beasts and obey different rules. Adding a proper 'cond' might help. All in IMAO.

'Cond' would help, indeed [1]. Deprecating guard sequences in 'if' expressions too [2]. :)

> On 6 January 2015 at 19:25, Thomas Lindgren <thomasl_erlang@REDACTED> wrote:
> Guards are a mess IMO, for reasons including, but not restricted to, the ones you mention.

The award goes to erlang:float/1, messiest guard ever [3]. I would like to see it deprecated (as other old type guards without the 'is' prefix) and the function to be renamed to integer_to_float/1.

[1] https://github.com/erlang/otp/pull/464
[2] https://github.com/rebar/rebar/commit/2c4d7d1d9bdc2a11d3f485f844500bf4c2aa77a2
[3] http://www.erlang.org/doc/man/erlang.html#float-1

More information about the erlang-questions mailing list