[cmake-developers] if (FOO == BAR) ...
Alexander Neundorf
neundorf at kde.org
Mon Mar 25 16:11:03 EDT 2013
On Monday 25 March 2013, David Cole wrote:
> I know. I understand your motivation, and that the present state of
> affairs is less than desirable.
>
> However, I still object to your patch on two grounds:
>
> (1) Using the name "==" implies that it is doing an equivalence
> comparison, similar to C / C++, where the same named operator may be
> used with multiple types of left and right hand sides.
>
> If we had it in CMake, one *should* logically be able to infer that any
> type of comparison would be possible: string, variable, int or float
> numbers, versions. But that wouldn't be true, and so people would have
> to re-learn their intuition about == and it would just be strange for
> almost everyone.
Yes, the "==" would actually do what would be more expected from "STREQUAL".
> (2) We already have 2 ways of doing EQUAL comparisons, and this would
> be a 3rd, without being complete, and without eliminating either of the
> other ways...
>
> This 3rd way, while having the nice feature of doing what you want
> w.r.t. string values, and not doing variable value lookup, would ADD to
> the confusion still more because it is counter-intuitive as noted above.
>
> Sorry, I just don't see this as a good addition overall.
No problem :-)
Alex
More information about the cmake-developers
mailing list