[Issue 320] New: Delegates should be allowed as foreach aggregates

Bruno Medeiros brunodomedeiros+spam at com.gmail
Wed Oct 18 07:38:02 PDT 2006


d-bugmail at puremagic.com wrote:
> http://d.puremagic.com/issues/show_bug.cgi?id=320
> 
>            Summary: Delegates should be allowed as foreach aggregates
>            Product: D
>            Version: unspecified
>           Platform: All
>         OS/Version: All
>             Status: NEW
>           Severity: enhancement
>           Priority: P3
>          Component: DMD
>         AssignedTo: bugzilla at digitalmars.com
>         ReportedBy: ibisbasenji at gmail.com
> 
> 
> Seeing as how foreach works on objects by calling a method with a certain
> signature, it should be feasible to allow delegates with that same signature as
> the aggregate.  This would provide a clear selective iteration concept, and
> with the use of delegate literals and delegates to nested functions, could
> possibly lead to a number of new design patterns.
> 
> 

This one just got implemented.

-- 
Bruno Medeiros - MSc in CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D



More information about the Digitalmars-d-bugs mailing list