Suggestions for multiple class members with the same name

Jarrett Billingsley kb3ctd2 at yahoo.com
Mon Aug 11 21:27:02 PDT 2008


"BCS" <ao at pathlink.com> wrote in message 
news:55391cb3304918cac9d9f784829e at news.digitalmars.com...
> Reply to Ary,
>
>> bearophile a écrit :
>>
>>> bobef Wrote:
>>>
>>>> Make this syntax valid:
>>>> A.a[1]
>>>> A.a.length
>>> Why? Can you show/tell some purpose of it?
>>>
>>> Bye,
>>> bearophile
>> I think he can't have a reference to the second "a" method, because
>> &A.a just returns the first one. So he's asking to treat "A.a" as an
>> array of methods.
>>
>
> ouch!
>
> better solution
>
> &A.a(char[])
> &A.a(int)
>
>

cast(uint function(char[]))&A.a

already works, but is terribly unwieldy, I'll agree. 





More information about the Digitalmars-d mailing list