kaspiana / mage

A command-line tool for cataloguing images (particularly digital art), styled after Git.
0 stars 0 forks source link

XOR operator #22

Closed kaspiana closed 3 months ago

kaspiana commented 3 months ago

An XOR operator should be added to the query language.

Binary XOR is equivalent to (x | y) & -(x & y), which is simple to implement.

n-ary XOR should be implemented with the intuitive definition that x ^ y ^ z is true only if only one of the operands is true, however this seems rather difficult to implement. Research may be required.