I have a suggestion.

BCS BCS at pathlink.com
Wed May 16 11:24:09 PDT 2007


antonio wrote:
> I think the more "algebraic" way could be something like
> 
> foreach(int i; reversed array)
> 
> compiler must act in the optimal way.
> 

or we could take a hint from scope and do:

foreach(reverse)(i;arr)

that leaves the door open for things like

foreach(stride, 5)(i;arr) {}

and

foreach(heaptree)(i;arr) {}

the overloads could be something like

opApply(char[] : "reverse")(int delegate(inout int));




More information about the Digitalmars-d-announce mailing list