[Issue 7666] New: A function to reverse the items of a tuple

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 7 11:13:28 PST 2012


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

           Summary: A function to reverse the items of a tuple
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2012-03-07 11:13:30 PST ---
In some situations I'd like a function to reverse a tuple:

reversed(tuple(a,b)) == reversed(tuple(b,a))
reversed(tuple(a,b,c)) == reversed(tuple(c,b,a))
reversed(tuple(a,b,c,d)) == reversed(tuple(d,c,b,a))


Once built-in associative arrays have a byPair() method, that returns a
2-tuple, a reversed(tuple(a,b)) is useful when you need the pairs in reversed
(value-key) order.

-- 
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