wisp-lang / wisp

A little Clojure-like LISP in JavaScript
https://gozala.github.io/wisp/
Other
982 stars 68 forks source link

Destructuring support #96

Open h2non opened 10 years ago

h2non commented 10 years ago

It would be great if adds support for data destructuring, like in [Clojure](http://clojure.org/special_forms#Special Forms--Binding Forms %28Destructuring%29):

Functions arguments:

(defn ^string join 
  [[a b]] (str b a))
(join [:foo :bar])

Let expressions:

(let [[first-name last-name & aliases]
    (list "Rich" "Hickey" "The Clojurer" "Go Time")])

Did you plan to support it? I could try to make a PR with this feature

Gozala commented 10 years ago

I would really like that & has being on my todo list for quite some time. I'm afraid I won't have much time to do it myself any time soon, I would be happy to get a pull request & even guide anyone interested through the process. So yeah if you wanna take a stab at it, please do!!

On Monday, April 21, 2014, Tomás Aparicio notifications@github.com wrote:

It would be great if adds support for data destructuring, like in Clojurehttp://clojure.org/special_forms#Special%20Forms--Binding%20Forms%20(Destructuring) :

Functions arguments:

(defn ^string join [[a b]](str b a))(join [:foo :bar])

Let expressions:

(let [first-name last-name & aliases])

Did you plan to support it? I could try to make a PR with this feature

— Reply to this email directly or view it on GitHubhttps://github.com/Gozala/wisp/issues/96 .

Regards

Irakli Gozalishvili Web: http://www.jeditoolkit.com/

Gozala commented 10 years ago

BTW @xkxx @jacereda also reached me out in regards to destructuring support. If one of you will end up working on it, could you please mention here to avoid duplication of efforts.

Thanks!

Fresheyeball commented 9 years ago

Any progress on this?