Re:Schwartzian Transform
by dang on Thursday December 17, 2015 @10:00PM
(#10756335)
I like the Arc idiom for this. Here's how to sort a list (say of stories) by some computed value (say a function called score):
If score is expensive, you just wrap it in memo:
Now it will compute each score once, save them in a table, and throw the table away when done.
[ Parent
| on HN ]
This also pops up in SICP, first in an exercise (a re-tread of fibonacci, SICP's fizzbuzz) and in several other places later.
It seems like an example of the importance and influence of notation - many commonly used languages these days have first class functions but nobody using a lisp-2 variant would have thought to give this particular thing a special name.
I don't follow the connection to Lisp-2. Can you explain?
There isn't one, I fatfingered my 1 into a 2 and it's too late to fix it, sorry. I just meant it ends up being the shortest, least weird notation for function composition. Clearly, the meta-notation has some problems...