Fantastic. Not on-board with the ^^^^ syntax - could be improved. But it reminds me of how sequential-character syntax is limiting, like if you were going to make an integrated circuit in strict 2 dimensions, without being able to bridge over traces sometimes in a minimally 3-dimensional way. This is like bringing programming into, literally, a new dimension.
Perhaps they could make use of all of those box-drawing characters that are just taking up space, and use them to pipe the characters in all sorts of directions!
This is hilarious, and clearly a joke, but it does make one think. I've always thought that it would be nice to have variables which you don't name, which only live over a couple of lines, where it's clear the variable is just for some plumbing and doesn't need a name. I wonder if there is actually something in these two concepts combined
Mentioned in another sub-comment, but Clojure's threading macros do this. They do it by making positional assumptions about the implicit argument: https://clojure.org/guides/threading_macros
Since R lets you define your own operators, they took '%>%' and defined it as "pipe the return value from one function as the first argument to another function," so you can do this:
> I've always thought that it would be nice to have variables which you don't name, which only live over a couple of lines, where it's clear the variable is just for some plumbing and doesn't need a name
There are several things that involve unnamed, shortlived plumbing vars; as well as various languages pipeline notations, therr is also this in scala lambdas:
I know this is a joke, but it really might be worth an experimental implementation, just to see where this leads. (Decent editor support would be critical.)
28 comments
[ 4.3 ms ] story [ 88.2 ms ] threadF(condition1,
Condition2)
Is worse than
F(
)The problem isn't tabs or spaces, it's trying to align to the length of the function name instead of adding a new line
https://www.tcl.tk/man/tcl/TclCmd/upvar.htm
https://en.wikipedia.org/wiki/Box-drawing_character
10 + 10 puts _ # prints 20
but that isn't available in ruby itself
There are several things that involve unnamed, shortlived plumbing vars; as well as various languages pipeline notations, therr is also this in scala lambdas:
can be written as: and even: as:- partial application notation with numbered arguments
- pattern matching
- anaphoric if and related notations
- point-free form (no names at all)
instead of:
Having: The other requires ugly whitespacing.Elixir's pipe is the same thing, though Clojure has a few extra forms to facilitate other variable passing patterns.
[1] https://perldoc.perl.org/perlform