Top 5

Matti Niemenmaa see_signature at for.real.address
Thu Oct 9 10:20:16 PDT 2008


Leandro Lucarella wrote:
> Mike, el  8 de octubre a las 16:51 me escribiste:
>> 2. Attributes - and deprecate some keywords we wouldn't need anymore
>>
>> // just an example; I don't really want to pick on foreach_reverse, although I wouldn't mind if it died :)
>>
>> foreach_reverse(a; b) { ... }
>>
>> [reversed] foreach(a; b) { ... }
> 
> I once saw somebody proposing template-like syntax for this:
> foreach!(reversed)(a; b) { ... }
> 
> But, well, I think first all the new-template-syntax fuzz has to stop ;)

We already have scope (success) and such, which need no !. Why not foreach
(reversed)?

Alternatively, since foreach got the ability to take a delegate, arrays should
have the built-in property .reversed and then you could do foreach (a; b.reversed).

-- 
E-mail address: matti.niemenmaa+news, domain is iki (DOT) fi



More information about the Digitalmars-d mailing list