[Issue 9857] UFCS for struct opCall

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Apr 2 16:51:24 PDT 2013


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


Jonathan M Davis <jmdavisProg at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisProg at gmx.com


--- Comment #8 from Jonathan M Davis <jmdavisProg at gmx.com> 2013-04-02 16:51:22 PDT ---
Personally, it feels very wrong to me that UFCS would work with constructors.
It's one thing to use it with normal free functions. It's quite another to do
stuff like this.

> I don't have a problem with the feature (it actually looks great with the ctor
> example you gave there), but it's hard to say what's expected when there's
> ZERO documentation for UFCS in the spec, which is ridiculous since we've had 
> this feature for the last several years and it has just expanded in 
> functionality ever since. Even TDPL barely talks about UFCS, and calls them 
> "pseudo members".

UFCS and pseudo members are two very different things as similar as they may
appear. Arrays had UFCS. That was it. That was all that was ever planned for,
and it may have been an accident that it worked in the first (I don't recall
for sure). Some tried to claim that TDPL said that it was in the language, but
all TDPL ever talked about was arrays, because that's all that there was and
all that was planned for. The only reason that it was ever expanded beyond
arrays was because people kept asking for it. It hasn't existed for very long,
and it was never really planned out AFAIK. Certainly, stuff like whether it
should work with overloaded operators or constructors or anything other than
basic free functions was never discussed or designed. It was just implemented
with the idea that it would work with free functions like arrays had been
doing, and the implications of that and the various corner cases were not
necessarily considered or examined in detail.

So, if anything, the problem is that the feature was ever implemented without
being designed first, and while it _should_ be properly documented by now, it's
also a semi-recent feature, so it's not particularly surprising that it's not
given how things work around here. But it _has_ been months (probably over a
year now, though I'm not sure) since it was introduced, so there's really not
much excuse for it not being documented other than the fact that the spec is
rarely kept up-to-date (which is just indicative of a larger problem).

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