Method invocation -- why it's not working?

Comrad comrad.karlovich at googlemail.com
Wed Mar 7 23:37:38 PST 2012


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.


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



More information about the Digitalmars-d-learn mailing list