[erlang-questions] Funargs: Ruby-like blocks for Erlang

Jachym Holecek freza@REDACTED
Fri Jul 22 02:25:21 CEST 2011

# Tony Arcieri 2011-07-22:
> On Thu, Jul 21, 2011 at 3:48 PM, Richard O'Keefe <ok@REDACTED> wrote:
>     And YEEK!  The argument list here
>     looks like nothing else in Erlang whatever!
>     Surely surely surely Erlang should look like Erlang!
>        lists:map([1,2,3,4,5]) do (N) -> N*2 end
> The "end" keyword, in all other cases in Erlang, is paired with a corresponding keyword, like "if",
> or "case", or "receive", or "try".

Please define what kind of correspondence you have in mind, and if you're
going to mention presence of some symbols in Latin alphabet please explain
why that matters at all. To me they're just syntactic items. I don't care
what characters they're made of as long as those are on my keyboard and
the result is easy to read and write (by me).

> Only in funs is "end" paired with the stabby symbol.

Let's have a look:

  fun (X) -> X end
  ^^^          ^^^

One more look:

  fun (X) -> X; (Y) -> Y end
  ^^^                    ^^^

See? Happy now? :-)

Have fun,
	-- Jachym

More information about the erlang-questions mailing list