opDollar

Tomas Lindquist Olsen tomas at famolsen.dk
Thu Sep 11 09:41:03 PDT 2008


Stewart Gordon wrote:
> "Bill Baxter" <wbaxter at gmail.com> wrote in message 
> news:mailman.89.1220922329.19733.digitalmars-d-announce at puremagic.com...
>> On Tue, Sep 9, 2008 at 9:37 AM, Andrei Alexandrescu
>> <SeeWebsiteForEmail at erdani.org> wrote:
>>> Denis Koroskin wrote:
>>>> 4) We need some way of supporting dollar notation in user 
>>>> containers. The
>>>> hack of using __dollar is bad (although it works).
> 
> Agreed.
> 
>>> It doesn't work for multiple dimensions. There should be an 
>>> opDollar(uint
>>> dim) that gives the library information on which argument count it 
>>> occured
>>> in. Consider:
> <snip>
> 
> opDollar is the wrong choice of name.  The op* methods are - as a rule - 
> named after the semantic function of the operator, rather than what the 
> operator looks like.  For example, opMul not opAsterisk, opIndex not 
> opSquareBrackets.  Consequently, opStar is already inconsistently named; 
> I think one such is enough.  As for what the function to overload $ 
> should be called ... how about opEnd?
> 
> Where did this conversation begin?  I can't seem to find any messages up 
> the thread from the one I'm replying to now.
> 
> Stewart.
> 

Since $ is used as a shortcut for for array.length, I'd say opLength is a better choice. Maybe 
I missed some of the discussion ...

-Tomas


More information about the Digitalmars-d-announce mailing list