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

Tony Arcieri tony.arcieri@REDACTED
Fri Jul 22 03:01:35 CEST 2011


On Thu, Jul 21, 2011 at 5:25 PM, Jachym Holecek <freza@REDACTED>wrote:

> 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.


I mean honestly, are you trolling me?

Tokens like "do" and "end" are words, or more specifically keywords. Tokens
like "->" are symbols. Believe it or not for most people groupings of
letters, as opposed to symbolic characters, actually has a significant
meaning.

To me they're just syntactic items.


Can you think like a human instead of a lexer?

Let's have a look:
>
>  fun (X) -> X end
>  ^^^          ^^^
>
> One more look:
>
>  fun (X) -> X; (Y) -> Y end
>  ^^^                    ^^^
>
> See? Happy now? :-)


No. Clause bodies are delimited by "->" and "end" with ";" as an optional
clause separator. The "fun" keyword is not the delimiter and can be used in
contexts where a fun has no clause body, such as fun module:function/arity.

-- 
Tony Arcieri
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110721/fc0b2dad/attachment.htm>


More information about the erlang-questions mailing list