Enhanced type guard syntax]

Bengt Kleberg Bengt.Kleberg@REDACTED
Thu Sep 18 16:46:55 CEST 2003


Joe Armstrong wrote:
...deleted
>   Adding  guards  like  this   violates  one  of  my  favorite  design
> meta-principles:
> 
>   " If  you add something  to a language  you have to  chuck something
> away "
> 

although i am very much in favour of this meta-principle (i got very 
strong reactions when suggesting a removal before (as in: not at) the 
scheme strawman workshop  (ICFP '98)), it does not apply in this 
particular case.

this is not adding something, instead it is extending an already 
existing feature to be more orthogonal. it should make erlang easier to 
learn. Var/binary is no longer a special case, but just another example 
of Var/builtin_type.

imho.


on the other hand, having both
foo(A, B) when integer(A), integer(B) ->
and
foo(A, B) when is_integer(A) and is_integer(B) ->
is a very strong violation of the meta-principle. it should be dealt 
with asap.


bengt




More information about the erlang-questions mailing list