DMD 0.170 release
Bruno Medeiros
brunodomedeiros+spam at com.gmail
Wed Oct 18 03:40:21 PDT 2006
Walter Bright wrote:
> Bruno Medeiros wrote:
>> Walter Bright wrote:
>>> Added foreach_reverse, which addresses a serious shortcoming.
>>>
>>> http://www.digitalmars.com/d/changelog.html
>>
>> foreach_reverse addresses a serious shortcoming? What is that, if
>> instead of:
>> foreach_reverse(Foo f; aggregate) { ...
>> I can do:
>> foreach(Foo f; &aggregate.opApplyReverse) { ...
>>
>> The latter form is both more general (allows any kind of iterators)
>> and more simple/orthogonal (no extra special statements are needed).
>
> The latter form works now.
I know it does (I said "can do" instead of "could do" :P ). So my
question remains.
PS: Note, for better readability, one can use a different (and better)
delegate name:
foreach(Foo f; &aggregate.iterReverse) { ...
--
Bruno Medeiros - MSc in CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
More information about the Digitalmars-d-announce
mailing list