C++ Logo

std-proposals

Advanced search

Re: [std-proposals] ^^operator [was: Re: New draft proposal: Add "%s" (two-digit truncated-integer seconds) as a std::format conversion specifier for std::chrono time types.]

From: Sebastian Wittmeier <wittmeier_at_[hidden]>
Date: Thu, 4 May 2023 10:50:52 +0200
Yes, that last part (only) with the operator chain is different to Simon's suggestion. The reason could be that Raku seems to generally return one of the input parameters for logical operators after analyzing their TRUEness. I.e. auto operator^^(auto A, auto B) { if(A) return A; if(B) return B; return nil; } And does similar things for AND, OR, ... Some prior art: https://docs.raku.org/language/operators#infix_^^ If chained to at least three operands: A ^^ B ^^ C ^^ ... unlike ^, it does not calculate parity, but whether exactly one operand is TRUE and does so in a short-circuit way. That seems different to Simon's suggestion, right? So the prior art for using the operator token is different again (although not as different as in D).

Received on 2023-05-04 08:50:54