September 22, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11092

           Summary: @commutative annotation for commutative functions
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: druntime
        AssignedTo: nobody@puremagic.com
        ReportedBy: daniel350@bigpond.com


--- Comment #0 from daniel350@bigpond.com 2013-09-22 03:16:01 PDT ---
The title should be self-expressive, for heavily constrained functions, it would be nice to just be able to tag them as commutative rather than spam the identical function prototype with a redirect to original.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 22, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11092


bearophile_hugs@eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs@eml.cc


--- Comment #1 from bearophile_hugs@eml.cc 2013-09-22 04:22:47 PDT ---
(In reply to comment #0)
> The title should be self-expressive,

This is an enhancement request, so the title is never self-expressive:
- What are some use cases?
- What are the limits?
- Do you mean just functions with two arguments?
- What if one, the other or both arguments have a default value?
- What about testing. QuickCheck-like tools for D would enjoy to know what
functions are annotated with such @commutative, to test at run-time they are
actually commutative. For this std.traits.functionAttributes will need to take
into account @commutative functions too.

More notes:
- std.functional.memoize could detect a @commutative function and sometimes
reduce the memory usage of its associative array.

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