[erlang-questions] Erlang elseif
Wed Nov 26 21:51:55 CET 2008
2008/11/26 Daniel Rönnqvist
> To make it short; I don't want Erlang to be like C, it seems you got so
> tangled up in your own agenda so I don't think you care anymore what I am
> talking about. What I would like is Erlang to be able to do what it does
> with nested cases in a better and non-nested syntax, like the proposed
> "cond" that Jay is talking about. Then the programmer could decide for them
> selfs if they want to use it or not.
I don't like the argument "Then the programmer could decide for them selfs
if they want to use it or not." Small concise languages are good; in
general, the fewer constructs the better.
This doesn't mean that I'm whole heartedly against a new conditional
construct, but I just don't see myself using it a whole lot. Right now I
use "case" quite a lot, and I find the vast majority of my conditions
involve matching patterns. I use "if" rarely; only in cases where there is
not pattern to match; for example, where I have a ranged comparison (X<Y).
In all cases that I have encountered so far, guards have been adequate.
My concern with adding a "cond" is that it would be over-used. It would be
used where a "case" would be more appropriate.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions