News for hackers. Stuff that matters.
Re:Racket: Parsing propositional logic in 33 lines by fanf2 on Friday October 16, 2020 @06:18AM (#24799356)
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)

Re:Racket: Parsing propositional logic in 33 lines by ahelwer on Friday October 16, 2020 @06:44AM (#24799467)
TLA+ 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.
Re:Racket: Parsing propositional logic in 33 lines by fanf2 on Friday October 16, 2020 @07:00AM (#24799556)
Aha, 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
Re:Racket: Parsing propositional logic in 33 lines by kazinator on Friday October 16, 2020 @01:38PM (#24803078)
XOR is just a Boolean "not equal to"; if I had to express that with > and <, I would crib from BASIC and use <>.
Re:Racket: Parsing propositional logic in 33 lines by ceceron on Friday October 16, 2020 @01:07PM (#24802800)
MiniZinc uses the \/, /\, ->, <-> as the logical connectives.
Re:Racket: Parsing propositional logic in 33 lines by ocfnash on Friday October 16, 2020 @06:32AM (#24799408)
Coq uses this notation for (propositional) and and or.