View mode: basic / threaded / horizontal-split · Log in · Help
November 06, 2012
Re: [ ArgumentList ] vs. @( ArgumentList )
On Tuesday, 6 November 2012 at 19:18:39 UTC, Walter Bright wrote:
> For User Defined Attributes.
>
> In the north corner we have the current champeeeeon:
>
> -------
> [ ArgumentList ]
>
> Pros:
>     precedent with C#
>     looks nice
>
> Cons:
>     not so greppable
>     parsing ambiguity with [array literal].func();
>
> ------
> In the south corner, there's the chaaaaallenger:
>
> @( ArgumentList )
>
> Pros:
>     looks like existing @attribute syntax
>     no parsing problems
>
> Cons:
>     not as nice looking
> ------
>
> No hitting below the belt! Let the games begin!

At first I liked the C# style, but it just does not mix well
with D's system attributes. So my vote is for..

@( ArgumentList )

I would prefer if I could enclose system and user attributes in 
the parenthesis, with no idea how that would work though.
November 06, 2012
Re: [ ArgumentList ] vs. @( ArgumentList )
Vote for "@( ArgumentList )"
Mostly because of current and yet possible ambiguity issue.
November 06, 2012
Re: [ ArgumentList ] vs. @( ArgumentList )
I'd like to re-enforce the consideration that @attribute() makes it looks
like they affect the code generation somehow... they're really just
annotations.


On 6 November 2012 21:47, Jacob Carlborg <doob@me.com> wrote:

> On 2012-11-06 20:18, Walter Bright wrote:
>
>> For User Defined Attributes.
>>
>> In the north corner we have the current champeeeeon:
>>
>> -------
>> [ ArgumentList ]
>>
>> Pros:
>>      precedent with C#
>>      looks nice
>>
>> Cons:
>>      not so greppable
>>      parsing ambiguity with [array literal].func();
>>
>> ------
>> In the south corner, there's the chaaaaallenger:
>>
>> @( ArgumentList )
>>
>> Pros:
>>      looks like existing @attribute syntax
>>      no parsing problems
>>
>> Cons:
>>      not as nice looking
>> ------
>>
>> No hitting below the belt! Let the games begin!
>>
>
> I vote for @( ArgumentList ). If this is syntax chosen I also hope
> @attribute will be legal as well.
>
> --
> /Jacob Carlborg
>
November 06, 2012
Re: [ ArgumentList ] vs. @( ArgumentList )
On Tuesday, 6 November 2012 at 19:18:39 UTC, Walter Bright wrote:
> Cons:
>     not so greppable

I'd argue that this is important.
November 06, 2012
Re: [ ArgumentList ] vs. @( ArgumentList )
On 06/11/2012 20:18, Walter Bright wrote:
> For User Defined Attributes.
>
> In the north corner we have the current champeeeeon:
>
> -------
> [ ArgumentList ]
>
> Pros:
>      precedent with C#
>      looks nice
>
> Cons:
>      not so greppable
>      parsing ambiguity with [array literal].func();
>
> ------
> In the south corner, there's the chaaaaallenger:
>
> @( ArgumentList )
>
> Pros:
>      looks like existing @attribute syntax
>      no parsing problems
>
> Cons:
>      not as nice looking
> ------
>
> No hitting below the belt! Let the games begin!

With [] I expect array operations; can I slice it?
November 06, 2012
Re: [ ArgumentList ] vs. @( ArgumentList )
On 11/6/12, Walter Bright <newshound2@digitalmars.com> wrote:
> @( ArgumentList )

I vote for @.

We have both arrays, static arrays, and hashes which use the []
syntax. And we have a precedent for @ with property functions and
other attributes (e.g. @disable).
November 06, 2012
Re: [ ArgumentList ] vs. @( ArgumentList )
On Tuesday, 6 November 2012 at 19:18:39 UTC, Walter Bright wrote:
> For User Defined Attributes.
>
> In the north corner we have the current champeeeeon:
>
> -------
> [ ArgumentList ]
>
> Pros:
>     precedent with C#
>     looks nice
>
> Cons:
>     not so greppable
>     parsing ambiguity with [array literal].func();
>
> ------
> In the south corner, there's the chaaaaallenger:
>
> @( ArgumentList )
>
> Pros:
>     looks like existing @attribute syntax
>     no parsing problems
>
> Cons:
>     not as nice looking
> ------
>
> No hitting below the belt! Let the games begin!

@() with optional ().
November 06, 2012
Re: [ ArgumentList ] vs. @( ArgumentList )
On 2012-11-06 20:52, Manu wrote:
> I'd like to re-enforce the consideration that @attribute() makes it
> looks like they affect the code generation somehow... they're really
> just annotations.

I still like the syntax.

-- 
/Jacob Carlborg
November 06, 2012
Re: [ ArgumentList ] vs. @( ArgumentList )
On 2012-11-06, 20:55, Faux Amis wrote:

> On 06/11/2012 20:18, Walter Bright wrote:
>> For User Defined Attributes.
>>
>> In the north corner we have the current champeeeeon:
>>
>> -------
>> [ ArgumentList ]
>>
>> Pros:
>>      precedent with C#
>>      looks nice
>>
>> Cons:
>>      not so greppable
>>      parsing ambiguity with [array literal].func();
>>
>> ------
>> In the south corner, there's the chaaaaallenger:
>>
>> @( ArgumentList )
>>
>> Pros:
>>      looks like existing @attribute syntax
>>      no parsing problems
>>
>> Cons:
>>      not as nice looking
>> ------
>>
>> No hitting below the belt! Let the games begin!
>
> With [] I expect array operations; can I slice it?
>

Of course. It's a typetuple.

-- 
Simen
November 06, 2012
Re: [ ArgumentList ] vs. @( ArgumentList )
On 6 November 2012 21:55, Faux Amis <faux@amis.com> wrote:

> On 06/11/2012 20:18, Walter Bright wrote:
>
>> For User Defined Attributes.
>>
>> In the north corner we have the current champeeeeon:
>>
>> -------
>> [ ArgumentList ]
>>
>> Pros:
>>      precedent with C#
>>      looks nice
>>
>> Cons:
>>      not so greppable
>>      parsing ambiguity with [array literal].func();
>>
>> ------
>> In the south corner, there's the chaaaaallenger:
>>
>> @( ArgumentList )
>>
>> Pros:
>>      looks like existing @attribute syntax
>>      no parsing problems
>>
>> Cons:
>>      not as nice looking
>> ------
>>
>> No hitting below the belt! Let the games begin!
>>
>
> With [] I expect array operations; can I slice it?
>

this is a really good point. they are a tuple, you can slice it, iterate
it...
further supports [] to my mind ;)
1 2 3 4 5 6
Top | Discussion index | About this forum | D home