accept @pure @nothrow @return attributes

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Wed Jan 28 10:49:01 PST 2015


On 1/28/15 10:37 AM, Jonathan Marler wrote:
> On Wednesday, 28 January 2015 at 18:27:34 UTC, Andrei Alexandrescu wrote:
>> On 1/28/15 10:19 AM, Jonathan Marler wrote:
>>> On Wednesday, 28 January 2015 at 17:52:56 UTC, Mike wrote:
>>>> On Wednesday, 28 January 2015 at 17:41:54 UTC, Jonathan Marler wrote:
>>>>
>>>>> PLUS, this would be very simple to implement!
>>>>
>>>> Then I recommend you submit a pull request.
>>>>
>>>> Mike
>>>
>>> I would but Walter said no.  I'm certain he misunderstood my proposal
>>> and I tried to explain it to him but I couldn't get him to address it.
>>
>> Was that the proposal leading to this state of affairs (quoting from
>> your post on 2015/01/26 16:05 PST?
>>
>>> Here's what would change
>>> -----------------------------------------------------------------
>>> void myfunc() nogc; // VALID (Only if this proposal is accepted)
>>> void myfunc() safe; // VALID (Only if this proposal is accepted)
>>>
>>>
>>> Here's what WOULD NOT change
>>> -----------------------------------------------------------------
>>> nogc myfunc(); // STILL INVALID: invalid unless it can be verified
>>>               //          that this wouldn't result in ambiguity
>>>               //          in the grammar
>>> void myfunc() @nogc; // STILL VALID (no change)
>>> @nogc myfunc(); // STILL VALID (no change)
>>
>>
>> Andrei
>
> You can follow this thread:
> http://forum.dlang.org/post/fxbqqecgqdhrepxsjnep@forum.dlang.org
>
> I explained my proposal 3 or 4 times but each time Walter seemed to be
> misunderstanding my proposal saying it was going to create
> "context-sensitive" tokens and so he would immediately dismiss it.  I
> tried to understand what he meant by "context-sensitive" tokens because
> my proposal didn't have anything to do with them (at least my definition
> of them), but even after he defined them my proposal clearly does not
> create them.
>
> Walter "[A context-sensitive token is] A keyword in one context and an
> identifier in another"
>
> Anyway, I'll restate my proposal again:
>
> 1. Modify the SYNTAX of function to allow it to be decorated with
> IDENTIFIER tokens on the right hand side
>
> void foo() x; // valid SYNTAX (note: has not semantic meaning)
> void foo() safe; // valid SYNTAX and valid SEMANTICS
>
> 2. Modify the code that interprets the syntax tree to recognize these
> identifiers as function attributes.
>
> A simple solution that would allow us to standardize where we put the
> function attributes and allow us to remove the '@' character from all
> non-keyword function attributes.  Seems like a no-brainer to me.

That's not a misunderstanding. Your proposal has been understood. It can 
be made to work. That doesn't necessarily make it desirable. I don't 
think it's particularly helpful and Walter is against it, so simply put 
it won't happen. Let it go. Thanks for it and keep the good ideas 
coming. -- Andrei



More information about the Digitalmars-d mailing list