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

Tony Arcieri tony.arcieri@REDACTED
Fri Jul 22 04:19:50 CEST 2011


On Thu, Jul 21, 2011 at 7:02 PM, Amy Lear <octopusfluff@REDACTED> wrote:

> This appears a little antagonistic. Jachym's responses appeared to be
> in good faith and serious to my perspective.
>
> I also don't make any kind of distinction between keywords with
> letters and keywords that are symbols, and I'm not clear on why this
> is important to change, at least in isolation. As Richard pointed out,
> if you're going to make syntax cleaner, you need to do it
> comprehensively.
>
> And I personally don't see any readability improvement, nor anything
> this permits us to do we couldn't before.
>

Well, my apologies, but I'm having a bit of trouble wrapping my brain around
the lack of aesthetic sense here. So forgive me for overreacting.

Here are some strategies to delimiting tokens that make sense to me:

"{" ... "}" - the oft reviled curly brace approach. These are a paired set
of tokens that match.

"beginningtoken" ... "endingtoken" - these match at least in that they're
words, and perhaps their meaning describes how they represent the beginning
and end of a block of code

"->" ... "." - these don't do a great job of matching up but they're kind of
acceptable because they're both symbols. The "->" character looks like an
arrow and makes a decent enough beginning token. The "." token has a long
history as the period character at the end of a sentence and imparts this is
where a function ends.

Now compare this to:

"->" ... "end"

Seriously. WTF is that? Those two tokens do not match up whatsoever.

The "->" token, elsewhere in Erlang, is found in "forms", which are
statements in that they do not return a value. They define functions and
can't be used from things which only comprehend Erlang expressions, such as
eshell.

The "end" token, elsewhere in Erlang, is only found in expressions, like
"case", "if", "receive", and "try". Expressions return a value.

Erlang fun syntax jams together the "->" token and the "end" token in
Erlang's lambda expression. In my opinion "->" does not belong in this
context. All of the other Erlang expressions are delimited by keywords. "->"
and "end" just don't match up as beginning and ending tokens.

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


More information about the erlang-questions mailing list