68 ms·
> 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 jus
by dragonwriter 6y ago
> 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:
xs.map(x => x + 1)
can be written as:
xs.map(_ + 1)
and even:
(xs, ys).zipped.map((x,y)=>x+y)
as:
(xs, ys).zipped.map(_ + _)