3 ms·
Lisp is all about being able to compile the latter to the former in compile-time, if you want it. That's the major problem lisp solves.
by gnulinux 8y ago
Lisp is all about being able to compile the latter to the former in compile-time, if you want it. That's the major problem lisp solves.
- samatman 8y agoHard agree! Still one is the latter and the other, the former. Hence I think the first tells more of the lisp story, with just a few more parens. ;-) "Why is it called REPL when the code says LPER? Well..."
- kazinator 8y agoWhy is it called "root mean square" when you square first, then take the mean, and then the root?
- ves 8y agoWe can just cut straight to “why is function composition backwards?”
- gnulinux 8y ago`(root (mean (square x)))` Is this more readable? `x ~> square . mean . root` Where `~>` "sends" a value to a function `x ~> f := f(x)` and `.` is the "backwards" function composition `f . g := \x (g (f x)) I think I prefer the "backwards" notation ("root mean square"), but I can see the appeal of "square mean root"
- Silfen 8y agoI like having both notations at my disposal. For example, F#'s forward pipe operator[0], or pipes from a unix shell. [0]https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/functions/index#function-composition-and-pipelining https://docs.microsoft.com/en-us/dotnet/fsharp/language-refe...
- drbojingle 8y agoIt's not backwards. The text is linear, but the code isn't. It's outer most nested function to the innermost nested function. Makes most sense if you think of HTML <html> <body> <div> </div> </body> </html> would compose as compose( html, body, div )