Method invocation -- why it's not working?
Jonathan M Davis
jmdavisProg at gmx.com
Wed Mar 7 23:50:57 PST 2012
On Thursday, March 08, 2012 08:37:38 Comrad wrote:
> On Thursday, 8 March 2012 at 06:43:45 UTC, Jonathan M Davis wrote:
> > On Wednesday, March 07, 2012 22:40:02 H. S. Teoh wrote:
> >> On Thu, Mar 08, 2012 at 07:32:18AM +0100, Comrad wrote:
> >> [...]
> >>
> >> > Basically, I was following Andrei's book, where this feature
> >> > is
> >> > described. It's a pity, that it's not working (except arrays
> >> > somehow)
> >> >
> >> > :( - I need it!
> >>
> >> Yeah there are some features in the book that aren't completely
> >> implemented yet. They are being looked into with high priority.
> >
> > True. But I would point out that TDPL never actually says that
> > it works with
> > all types. It only shows it with arrays. Now, it's not entirely
> > clear on
> > whether it's supposed to work with all types, but it definitely
> > doesn't say
> > that it does. It wouldn't surprise me at all if Andrei wrote it
> > with the
> > intention that it was only supposed to work with arrays but
> > wasn't clear
> > enough in his description.
>
> It's not correct. In TDPL it is clearly stated, that this is a
> general feature
> of the language.
Then please give me a page number. Last time I looked it over, I saw _nothing_
which said that it worked on types in general, and _all_ examples used arrays.
> > Still, there are definitely a lot of people who want it to work
> > with all types,
> > so it's likely that it will be expanded to work with more
> > types. Whether it
> > will ever work with _all_ types is somewhat in question due to
> > ambiguity
> > issues involving structs and classes (e.g. when a member
> > function and a free
> > function using UFCS would conflict). But there's a decent
> > chance that that will
> > be resolved and UFCS will end up working for all types. Until
> > then though, all
> > it works with is arrays.
> >
> > - Jonathan M Davis
>
> Anyway, for structures this feature is really needed.
It would be nice, but I honestly don't understand the people who think that
the lack of it is crippling. It's just one of those nice-to-have features.
Most languages don't have anything of the sort.
- Jonathan M Davis
More information about the Digitalmars-d-learn
mailing list