3 ms·
I wrote something similar for Scheme - https://cons.io/reference/sugar.html#chain https://cons.io/reference/sugar.html#chain. It's interesting to see that other
by thibran 7y ago
I wrote something similar for Scheme - https://cons.io/reference/sugar.html#chain https://cons.io/reference/sugar.html#chain. It's interesting to see that other people came up with a quite similar solution, providing two modes: pass-directly, pass-by-variable. Does the JS version supports destructuring?
- bjoli 7y agoI have a similar scheme thing, but that does implicit left or right insert when no <> is present and has an apply <...>: https://bitbucket.org/bjoli/guile-threading-macros/src https://bitbucket.org/bjoli/guile-threading-macros/src I wrote it when I was a beginner at syntax-rules macros, but it gets the job done. It doesnt do destructing though!
- thibran 7y agoYour version is interesting too. For a while I also thought about the stop-when-false idea, but came to the conclusion that it should probably be another macro. Building an enough powerful, but easy macro, isn't that simple.