Function pointer array slice?

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jul 11 22:24:31 PDT 2015


On Sat, 11 Jul 2015 11:37:03 +0000, Tofu Ninja wrote:

>>   void function() nothrow pure @nogc @safe [2]arrayName;
>>
>> is perfectly fine too.
> 
> Ahh, guess that makes sense, I kept trying to put the [] over near
> function()...

attributes are the parts of the type. and the rule is really simple: put 
"[]" array declaration immediately left of the array name. ;-)

> looks weird as hell though. I really wish you could put
> types in parens, I feel like things like this would make way more sense
> if you could write
> 
>       (void function() nothrow pure @nogc @safe)[] arrayName;
> 
> Reading it, that makes wayyy more sense to me, to bad I can't write
> this...

i agree, this is somewhat easier to read. but it requires grammar 
changes, i believe, and dunno what consequences that may have. yet it may 
worth filling a ER.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20150712/1ed46930/attachment.sig>


More information about the Digitalmars-d-learn mailing list