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

This is described later in the tutorial (ctrl-f "lisp heresy"). It's a macro that I wrote, not something built into Janet -- I'm sure I'm not the first person to do this, but I'm not aware of any lisps that have such a construct built-in.


Clojure has the thread first/last macros -> and ->> which pipes each result to the next form.


Yeah, and Janet copies Clojure's threading macros (that's how I implemented pipe syntax -- split on pipes, add some parens, and stick them into a -> form). I've just never seen it done infix like this -- it's very convenient when you don't have something like paredit to quickly wrap an expression.


And this is why Lisp is amazing. Seeing the question I immediately thought “this looks like a really nice convenience macro for the author’s preferred formatting”!




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

Search: