4 ms·
There’s a fun old-school spelling for the logical AND and OR operators in languages that officially spell them ∧ or ∨ but need to be typed in ASCII: /\ and \/
by fanf2 6y ago
There’s a fun old-school spelling for the logical AND and OR operators in languages that officially spell them ∧ or ∨ but need to be typed in ASCII: /\ and \/
I am having trouble finding real world examples right now, but it happens in languages like ALGOL and CPL (tho they predate ASCII)
- ocfnash 6y agoCoq uses this notation for (propositional) and and or.
- deleted 6y ago[deleted]
- ahelwer 6y agoTLA+ is an example. What I really like about this notation is you can use alignment to indicate precedence: \/ /\ A /\ B \/ /\ C /\ D Which represents (A & B) || (C & D). It helps quite a bit for parsing large formulas in your head. In TLA+ the individual expressions are usually much more complicated than a single variable.
- deleted 6y ago[deleted]
- fanf2 6y agoAha, occam is another example, but it uses AND and OR for logical expressions but \/ or /\ for bitwise, plus the exciting >< for xor! http://transputer.net/obooks/obooks.asp http://transputer.net/obooks/obooks.asp
- kazinator 6y agoXOR is just a Boolean "not equal to"; if I had to express that with > and <, I would crib from BASIC and use <>.
- ceceron 6y agoMiniZinc uses the \/, /\, ->, <-> as the logical connectives.