We might add an evolution of the display of parentheses...
B&W ()
B&W and optional bold ()
B&W and optional bold/larger ()
Full color rainbow parentheses.
B&W ()
One or two of the Lisp editors I use also support rainbow parentheses, but after an initial phase of experimentation, I have disabled that feature.
That was a tasty read! The Y-combinator implementation gave me a slight headache, but I averted my eyes and all was OK.
Scheme as a language and from a clean/simplicity point of view has always appealed to me, but I have mostly used Common Lisp because I have so much legacy code.
Has someone tried to evaluate all the solutions in terms of memory/CPU usage? Or do all the differences end up optimised away?
I like how in F# things are simpler:
let factorial n = [1..n] |> List.reduce (*)
Zen of Python
> There should be one-- and preferably only one --obvious way to do it.
> Although that way may not be obvious at first unless you're Dutch.
And then there’s Raku; say [*] 1..$n
(2020)
Isn't this missing the joke? The Haskell article code ended with the "Tenured Professor" implementation (`fac n = product [1..n]`) as a nod to the old trope of not needing to implement anything. This article ends with `(define factorial (dynamic-require 'math/number-theory 'factorial (lambda () lambda (n) (error 'factorial "Cannot import library: ~a" 'math/number-theory)))))`.
Surely there is a lazier implementation than a define and 2x lambdas to use a library function. Although I did get a chuckle about not feeling a need to add brackets to the Scheme example.