DMD 0.170 release
Kawa
kawa at kinside.com
Tue Oct 17 10:27:25 PDT 2006
Lars Ivar Igesund 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).
>>
>
> Good point and ties in with Tom's post; both of these features
> (foreach_reverse and delegate-as-aggregate) could be easily implemented
> using other constructs with some "fixes" to the core language.
>
+1 foreach(Foo f; &aggregate.opApplyReverse) seems a much more powerful form
More information about the Digitalmars-d-announce
mailing list