Boost logo

Boost :

Subject: Re: [boost] [type_traits] Most Unifying Proposal for operator names Was: Review Typetraits Extension.
From: Joachim Faulhaber (afojgo_at_[hidden])
Date: 2011-03-24 13:42:07


2011/3/24 Stewart, Robert <Robert.Stewart_at_[hidden]>:
> Joachim Faulhaber wrote:
>> 2011/3/24 Stewart, Robert <Robert.Stewart_at_[hidden]>:
>>
>> > I have some quibbles with your MUP choices, though.
>> > For example, you cite std::plus, minus, multiplies, and divides
>> > as naming examples from the standard,
>>
>> I was thinking about you, when I saw them, they're pretty
>> inconsistent, aren't they?
>>
>> > yet those are the names of function objects, not of operators.
>>
>> true
>
> This is, in my mind, a significant point which you overlook below.
>
> [snip "addition," etc. and "add," etc.]
>
>> I agree these names are nicer as those chosen by the standard
>> and proto ...
>>
>> Still
>>
>> (1) I would prefer uniformity over improvement here. I think it is of
>> greater value, if we manage to converge names in boost and the
>> standard, specifically in fields that are very fundamental to c++ as a
>> language, which is clearly the case here.
>
> It isn't uniformity when they name different things.  Indeed, I consider using the same names for different things to be confusing.

Hmm, not extremely different though. The way the std functors are
implemented is that they just call the operators without changing the
semantics that is implemented for a given type parameter they are
working on.

>> (2) If we considered to choose new names, I'd clearly prefer names
>> that emphasize on syntax, to make clear that semantics is attached to
>> operators by implementation
>>
>>  sign   semantics
>> + cross  addition, set union, concatenation, ...
>> - dash   subtraction, set difference, deletion ...
>> * star   multiplication, intersection, Cartesian product ...
>> / slash  division, factorization, ...
>
> I'd never think of "cross" for "+".  It has always been a "plus sign" to me.  You also have the problem of "*" being "asterisk" and "-" being "hyphen" to different people.  Besides, what would you call the corresponding concepts?  IsDashable?  IsStarable?

Hmm different domains: Signs relate to the lexical/syntactic level,
concepts to the semantic level...

... but I admit, some aspects of the lexical approach might be a little odd.

Don't get me wrong. I like your naming proposals, but I'm still not
convinced that the differences between the operators and their
associated functors is so fundamental that it justifies to sacrifice a
possible convergence of names.

Regards,
Joachim

-- 
Interval Container Library [Boost.Icl]
http://www.joachim-faulhaber.de

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk