You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to have support for destructuring within function arguments. For example,
(defnfoo [[x y]]
(+ x y))
(foo [12]) ; => 3
I think this would be relatively easy to add by slightly changing the definition of the defn macro, or maybe a new defn+ macro. A possible implementation could be (this ignores any possible &optional and &rest variables)
Associative destructuring like in clojure would also be really useful, but I can't see how to make this work nicely with python's list destructuring. As a starting point, this simple example works but is not recursive:
The sequence version used to be built-in, and then was removed by #1590. A pull request to add something more like Clojure, namely #1328, eventually petered out.
It would be nice to have support for destructuring within function arguments. For example,
I think this would be relatively easy to add by slightly changing the definition of the
defn
macro, or maybe a newdefn+
macro. A possible implementation could be (this ignores any possible&optional
and&rest
variables)Associative destructuring like in clojure would also be really useful, but I can't see how to make this work nicely with python's list destructuring. As a starting point, this simple example works but is not recursive:
The text was updated successfully, but these errors were encountered: