[Issue 7177] $ should forward to length by default

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 24 12:55:42 PDT 2013


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



--- Comment #46 from Steven Schveighoffer <schveiguy at yahoo.com> 2013-03-24 12:55:40 PDT ---
(In reply to comment #44)
> 1. hasLength!T || isNarrowString!T, but T does not define a member opDollar.

this can be shortened to hasLength!T, all strings define $, they are arrays. 
The compiler shouldn't be trying to guess whether something is a narrow string
or not according to phobos (or maybe I read this too literally?)

The rest of this is not unreasonable, and aside from breaking current code
(albeit less common current code in a non-obvious way), this proposal misses
one situation:  you want to define .length, but NOT opDollar.  In this case,
@disable opDollar should be allowed (if it's not already) as monarchdodra
suggested.

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