Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Text after a blank line that is indented by two or more spaces is reproduced verbatim. (This is intended for code.) [0]

So...

  (-
    (+ (* 3 4)
       (- 3 1))
    3)
And...

  (->> 3
       (* 4)
       (+ (- 3 1)
       (- 3))
[0] https://news.ycombinator.com/formatdoc


I often write threaded math but it unfortunately it doesn't compose cleanly with division :) (subtraction can be transformed into an addition without too much extra)

If you do thread-last and then need to divide by some value, you will need to write something like (* (/ 1 37)) which is ugly

I think you could actually write a fraction here, but if instead of 37 you have a binding then that doesn't work


Ah nice, thank you!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: