Honestly I'm not really worried about the "band wagon" or what other languages do. CMake is its own independent entity and domain language, if the feature is useful then it should have it :) Anyway I was just wondering if the feature would be accepted & useful. As I said I don't mind doing the work.
Not every operator needs to short circuit. If you can't short circuit, then you can't. For example, in C++ you understand what short circuiting rules are and you work with that. But not every C++ operator allows it. Also FWIW, in Python you can kind-of get XOR by converting both operands to boolean: bool(a) != bool(b) But we can't cast operands to bool on-the-fly in CMake (AFAIK) so this wouldn't be feasible. On Wed, Sep 12, 2012 at 6:49 AM, Brad King <[email protected]> wrote: > On 09/11/2012 05:09 PM, Robert Dailey wrote: >> I don't see an exlusive or operator in CMake. Could I add one? Would >> such a feature be accepted? >> >> Syntax would be: >> >> if( var1 XOR var2 ) > > Many languages like C, C++, python, lua, etc. do not offer > logical XOR operators, only bitwise XOR. Unlike AND/OR/NOT > the XOR operation cannot be used in short-circuit evaluation > (CMake's if() command does not currently short-circuit, but > it could.). > > -Brad -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
