[Issue 7177] $ should forward to length by default

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Mar 21 12:56:06 PDT 2013


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


timon.gehr at gmx.ch changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |timon.gehr at gmx.ch


--- Comment #30 from timon.gehr at gmx.ch 2013-03-21 12:56:04 PDT ---
(In reply to comment #16)
> The idea in comment #11 is interesting, but one problem point is that current
> compiler does not see UFCS fallback for operator overloading.
> 

Making this work enables transparent introduction of the opDollar requirement
for eg. finite RandomAccessRanges.

> If we accept it, should we also accept this?
> 
> string opBinary(string op)(string s1, string s2) if (op == "+") {
>     return s1 ~ s2;
> }
> void main() {
>     assert("hello " + "world!" == "hello world!");
>     // --> "hello ".opBinary!"+"("world!")    // op-overloading
>     // --> .opBinary!"+"("hello ", "world!")  // UFCS
> }

IMO yes. In any case, there is nothing in the spec that would indicate that it
does not work.

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