I guess expressions don’t really need to read left-to-right on a line. Why can’t a < b be written vertically too? a < b All this time we’ve been writing expressions in 1D space, but what happens when we unlock an extra dimension? Of course the IDE and parser need to play nicely for all this to work. Even then, what’s the point? Well, let’s take a look at these examples below. 3-arity functions We don’t really see 3-arity functions written in infix notation much. For example, in Python (and most other languages), you can and 3+ things at once: Technically, that’s just composing multiple binary functions together. Even this shortcut in Python to simplify (a < b) and (b < c) is more of the same thing: Now, let me introduce you to a funny little operator I’ve been playing with called andFlip, which motivates the need for a true 3-arity infix notation. First, here’s the definition of the function: def andFlip(args): if args[0] and args[1]: args[2] = not args[2] return args[2] It takes 2 inputs and flips the target if both inputs are true. There’s just no good way to write this with infix notation. But let’s try anyways! Define @@ to be the infix symbol for the andFlip operator. What does it look like in practice? Method 1: the standard way One option is to curry andFlip: the infix @@ takes 2 args and returns a function awaiting the 3rd, like so: Yeah, that’s alright. It works. But… Method 2: the goofy way Forget what you know about code for a second. If I could flick a magic wand, I’d wish for the 3-arity notation to look like this: a3 a1 @@ a2 Might as well make use of the y-axis, right? It makes chaining so much easier: t1 = 0 t2 = 0 t1 t2 (x @@ y) @@ z In the chain, x @@ y toggles t1, and t1 continues the chain t1 @@ z, which toggles t2. That’s a successful three-way toggle, where all x, y, and z must be true for the target to toggle. Btw, since we’re working in 2D space now, the following expression, t1 x @@ y is equivalent to: x @@ y t1 Example: my chicken coop door...
First seen: 2026-07-23 16:06
Last seen: 2026-07-26 00:50