On Wed, 5 Aug 2020 at 13:20, Benjamin Eberlei <kont...@beberlei.de> wrote:

>
> It looks nice for a simple attribute like @@Jit, or for a one without
> arguments like the used @@Deprecated, but as soon as there are more than
> one, and they each get arguments, enclosing them has its own benefits over
> them just standing for themselves.
>


The confusing thing about this argument is that as soon as they have
arguments, attributes will have an ending delimiter _whatever_ syntax we
choose, because nobody has ever proposed removing the parentheses around
the arguments.

Detecting the closing parenthesis requires pairing off any parentheses
inside the argument list, but that's still true of the closing bracket in
@[...]. If we make the closing delimiter some random combination like @#]]
then you _still_ need to parse the arguments, because they could contain a
quoted string with those characters in.

While I'm generally in favour of delimited syntaxes, I'm struggling to see
the difference in value between "parentheses are mandatory even if there
are zero arguments" and "the syntax includes an extra pair of outer
brackets".

With no parameters:
@@Foo()
@(Foo)
@[Foo]
@[Foo]@

With complex parameters:
@@Foo('hello @@ world', (1+2)*3)
@(Foo('hello @@ world', (1+2)*3))
@[Foo('hello @[ world ]', [1,2,3])]
@[Foo('hello @[ world ]@ again', [1,2,3])]@

Regards,
-- 
Rowan Tommins
[IMSoP]

Reply via email to