Hacker News .hnnew | past | comments | ask | show | jobs | submitlogin

I just put out a new release of TXR, which has a change that can reduce the nesting.

In pipes, you can now bind variables that are in scope of later pipeline elements.

  1> (flow "/usr/share/dict/words"  ; start with this path
       (file-get-lines)             ; get content as list of lines
       (let lines)                  ; bind lines variable to this list
       len                          ; take length of list
       rand                         ; get pseudo-random in [0, length)
       lines)                       ; index into lines
  "subdues"


Clojure has several threading macros: https://clojure.org/guides/threading_macros


These can all be defined in CL and have been.

https://quickref.common-lisp.net/arrows.html




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

Search: