4 ms·
Janet, like some other lisps, has the arrow macro, which allows you to write in the “OO” style. (-> a (fun b c))
by xigoi 1y ago
Janet, like some other lisps, has the arrow macro, which allows you to write in the “OO” style.
(-> a (fun b c))
- uvas_pasas_per 1y agoSomething like this combined with some IDE smarts to offer up the possibilities for `fun` after I type `(-> a` ... that could be very cool.
- terminalbraid 1y agoYou mentioned autocompletion a few times and that is something available via LSPs (janet specifically has one that has this) or through the editor (e.g. emacs can use swank for common lisp). It's no different for any other language integration.
- worthless-trash 1y agoI think that threading macros is different to method chaining (at least to my understanding), method chaining works on the object returned, and threading macros can work on raw data or objects.
- zelphirkalt 1y agoAh neat! In Guile I use threading/pipelining all the time with a small macro: (define-syntax -> (syntax-rules () ;; first expression is left unchanged [(-> expr) expr] ;; take from the back, wrap other calls [(-> expr* ... (op args* ...)) (op args* ... (-> expr* ...))] ;; make parens unnecessary in trivial case of no further arguments [(-> expr* ... op) (op (-> expr* ...))])) Janet already having this ... Reading many good things about Janet in this discussion.