www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11092] New: commutative annotation for commutative functions

reply d-bugmail puremagic.com writes:
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



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: -------
Sep 22 2013
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11092


bearophile_hugs eml.cc changed:

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




 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: -------
Sep 22 2013