Why one and two levels of call_args_parens, but not more?

58 views
Skip to first unread message

Luke Imhoff

unread,
Apr 23, 2015, 10:41:00 PM4/23/15
to elixir-l...@googlegroups.com
In the max_expr and block_expr, parens_call can be followed by either one call_args_parens or two call_args_parens, but no more.  Tracing the history, it looks like that part of the grammar originated from https://github.com/elixir-lang/elixir/commit/c7a7022bf32317aa664ab40fad97e902f8f8cedc.  From the tests, is two call_args_parens allowed just to support function call parentheses after unquote parentheses?  If that's the case why didn't the recursive form work out?  Did you want to prevent macro/dsl authors getting too far from standard Elixir syntax which only needs the 2 levels?

José Valim

unread,
Apr 27, 2015, 2:37:54 PM4/27/15
to elixir-l...@googlegroups.com
We haven't allowed it just because the non-recursive solution is the simplest solution. :)

Allowing foo()()() wouldn't amount to valid elixir code anyway (unless in a quoted expression) and the only form that is allowed in actual code with two calls is unquote(foo)(bar).



José Valim
Skype: jv.ptec
Founder and Lead Developer

On Fri, Apr 24, 2015 at 4:41 AM, Luke Imhoff <kroni...@gmail.com> wrote:
In the max_expr and block_expr, parens_call can be followed by either one call_args_parens or two call_args_parens, but no more.  Tracing the history, it looks like that part of the grammar originated from https://github.com/elixir-lang/elixir/commit/c7a7022bf32317aa664ab40fad97e902f8f8cedc.  From the tests, is two call_args_parens allowed just to support function call parentheses after unquote parentheses?  If that's the case why didn't the recursive form work out?  Did you want to prevent macro/dsl authors getting too far from standard Elixir syntax which only needs the 2 levels?

--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/915ebac1-318e-41ac-b182-80667dd3c6d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages