[parenscript-devel] A more useful destructuring bind

David Sargeant david at dsargeant.com
Tue Jan 15 14:38:03 UTC 2013


The current DESTRUCTURING-BIND could be much more useful if you could pull apart objects and arrays.  CoffeeScript has a great mechanism for this (http://coffeescript.org/#destructuring).  Below is an example of what this macro might look like in parenscript.  Let me know your thoughts.

David


(d-bind (:obj name (:obj firstname lastname)
              likes (:arr first-like second-like))
        (create :name (create :firstname "Joe" :lastname "Blo")
                :occupation "Web Developer"
                :likes '("programming" "woodworking" "cycling"))
        (alert (+ "Your name is " firstname " and you like " first-like)))

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/parenscript-devel/attachments/20130115/dd2394fd/attachment.html>


More information about the parenscript-devel mailing list