On Mon, Oct 26, 2020 at 12:04 PM Elizabeth Mattijsen <[email protected]> wrote:
> Personally, I would avoid the use of the anonymous state variable. I
> think it is an example where Larry would nowadays apply rule #2.
>
Well, I wouldn't use a construction like that in real code. It just seems
like one of the simpler ways to introduce anonymous state variables.
For the end of my talk, I plan to explore a golfing challenge I worked on a
while ago that calls for zipping two infinite sequences together with the
replication operator xx, where the second sequence is:
1, 1, 2, 2, 3, 3, 4, 4, ...
I wasn't really happy with any of the ways I came up with to generate that
second sequence, like:
{ 1 + $++ div 2 } ... *
map * div 2, 2 .. *
Then I had the sudden inspiration that xx coerces its second argument to
Int, meaning all I really needed was:
1, 1.5 ... *