-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Currently, it's somewhat inconvenient to match call expressions that have nested call expressions.
a(b(c(x), y), z)
=
(call f (call g (call c x) y) z)
At least partially, #10 solves this issue:
a(b(c(x), y), z)
(call f (call g (call c)))
(expr "a(b(c(x), y), z)")
But that will not work if any of those call expressions need any advanced features.
Some lisps solve this problem by threading macros.
(f (g (c x) y) z)
=
(->> (c x) (g y) (f z)) ;; "thread last"
(as-> (c x) $ (g y $) (f x $)) ;; "thread as"
It does not make code shorter, but helps to avoid excessive nesting.
Metadata
Metadata
Assignees
Labels
No labels