[erlang-questions] eep-0012 (Extensions to comprehensions)

Gustavo Niemeyer gustavo@REDACTED
Wed Aug 6 20:10:44 CEST 2008


(...)
> My propose is to introduce a fourth generator:
> 1, [<-] is for iterating over lists
> 2, {<-} is for iterating over tuples
> 3, <<<->> is for iterating over binaries
> and
> 4, (<-) for iterating over anything else.

My personal feeling is that part of the Erlang syntax seems to be optimized to
make the compiler simpler/faster rather than the programmer's life.  I'm a bit
ashamed of saying this here because I don't want to start a silly
flame war.  I just
honestly hope that one of the consequences of the uptake that Erlang seems to
be getting is that at some point part of the syntax (punctuation, mostly) is
reviewed towards making the programmer's life a bit easier.

A few suggestions, to serve as examples:

- A single iteration syntax, so that one doesn't have to remember the
  various flavors and switch the flavor as the variables change;

- Optional commas at the end of a list or tuple ({1,2,}) so that one can always
  put a comma at the end of the line on lists spread through multiple lines;

- Allowing the last block to have a semi-colon on if/case/receive/etc.

I'm quite new to Erlang, and thus these sound like minor warts that I'm
definitely getting used to.  So feel free to ignore me.  That said, newcomers
are able to detect some long standing issues that may prevent further adoption,
which isn't obvious to old timers, and that's why I post here.  My opinion alone
isn't very important, but please watch out if these warts are being mentioned
over and over.

-- 
Gustavo Niemeyer
http://niemeyer.net



More information about the erlang-questions mailing list