[Issue 10009] foreach_reverse and AA.byKey/byValue

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri May 3 14:43:33 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10009


Steven Schveighoffer <schveiguy at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schveiguy at yahoo.com


--- Comment #8 from Steven Schveighoffer <schveiguy at yahoo.com> 2013-05-03 14:43:31 PDT ---
The problem I see with removing foreach_reverse is that the compiler actually
rewrites it directly instead of calling a function.  Requiring to use retro
when it is in std.range is not good for modularity.

In addition, foreach_reverse(x..y) is nice to use instead of some combination
of ranges.

However, I don't think foreach_reverse is valid for this use case.  An AA is
only forward-traversable.  foreach_reverse is not possible, as buckets are
stored as singly-linked lists.  If you want that, you need to first capture it
as an array.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list