cairdcoinheringaahing / jellylanguage

Jelly is a recreational programming language inspired by J.
MIT License
4 stars 0 forks source link

Logical XOR #1

Open pxeger opened 3 years ago

pxeger commented 3 years ago
logical_xor(zero, zero) = false
logical_xor(zero, non_zero) = true
logical_xor(non_zero, zero) = true
logical_xor(non_zero, non_zero) = false

This is based on whether the argument is truthy or falsey, not anything to do with its bits.

Also xnor, which is not(logical_xor(a, b))

cairdcoinheringaahing commented 3 years ago

I don't see this coming up enough to dedicate a single byte dyad to, however a digraph (e.g. œx as œ^ already exists) could certainly be useful. As for xnor, I'm not sure if it'd be worth it over just œx¬

pxeger commented 3 years ago

I agree, a single byte would certainly be wasteful. And you're probably right about xnor.