4 ms·
> reading from right to left, bottom to top - from inside out I don't understand why you think this. Can you give an example?
by buttercraft 2y ago
> reading from right to left, bottom to top - from inside out
I don't understand why you think this. Can you give an example?
- fc417fc802 2y agoDoes this example help? https://github.com/ghollisjr/cl-ana/blob/master/binary-tree/binary-tree.lisp#L89 https://github.com/ghollisjr/cl-ana/blob/master/binary-tree/...
- kazinator 2y ago(log (sqrt (sin (* 2 pi x)))
- freehorse 2y agolog (sqrt (sin (2 * pi * x))) Seems as much right to left to me as the original one. And just 2 deletions (you missed closing the opening parenthesis) and 2 insertions.
- kazinator 2y agoRight. The ergonomic problem people face is that the chaining of functions appears in other contexts, like basic OOP. Some kids trained on banana.monkey().vine().jungle() go into a tizzy when they see (jungle (vine (monkey banana)))).
- freehorse 2y agoNot sure of other lisps, but clojure has piping. I was under the impression in general that composing functions is pretty standard in FP. For example the above can be written: (-> (* 2 PI x) sin sqrt log) Also while `comp` in clojure is right to left, it is easy to define one left to right. And if anything, it even uses less parentheses than the OOP example, O(1) vs O(n).
- jdougan 2y ago(2 * pi * x) sin sqrt log