accept @pure @nothrow @return attributes

Nick Treleaven via Digitalmars-d digitalmars-d at puremagic.com
Tue Jan 27 10:21:37 PST 2015


On 27/01/2015 18:01, Jonathan Marler wrote:
> On Tuesday, 27 January 2015 at 17:18:11 UTC, Nick Treleaven wrote:
>> On 27/01/2015 16:49, Jonathan M Davis via Digitalmars-d wrote:
>>> abstract also applies to classes, as does final.
>>
>> Yes, but they actually only affect the *functions* belonging to the
>> class, not the variables. A class is not a variable.
>>
>
> I think you may have missed the point.  I believe what Jonathan is
> saying is that if you turn abstract into @abstract then you have to
> consider how to solve the "abstract class" issue.  Do you change it to:
>
> @abstract class ?

Yes, because it affects the class's functions, not its variable members.

> Same thing with final.  Since the same keywords are used in a lot of
> different contexts, if you change how it is used in one context then
> it's going to be inconsistent with how it's used in the other contexts
> (like with a function or a class).  Then if you want consistency (which
> is the point of why we are discussing this change in the first place)
> you have to change every context it is used in. If you follow through
> with your proposal, you'll end up putting a '@' character before almost
> every keyword in the language

In that case I don't think you've really grokked my proposal. It only 
requires 5 changes to attributes for consistency (and that's counting 
@pure and @nothrow).


More information about the Digitalmars-d mailing list