metabang-bind

Sticking the pedal to the metal fun

What it is

Bind combines let, destructuring-bind and multiple-value-bind and a whole lot more into a single form. The user guide has all the details but here is example to whet your appetite:

(bind ((a 2)  
       ((b &rest args &key (c 2) &allow-other-keys) '(:a :c 5 :d 10 :e 54))  
       ((:values d e) (truncate 4.5)))  
  (list a b c d e args))  
==> (2 :A 5 4 0.5 (:C 5 :D 10 :E 54)) 

Bind is especially handy when you have more than one layer of multiple-value-bind or destructuring-bind. Since bind is a single form, you don't end up too far off to the right in editor land.

Bind is released under the MIT license.

Mailing Lists

Use the developer mailing list for any questions or comments regarding bind.

Where is it

A Darcs repository is available. The command to get bind is:

darcs get http://common-lisp.net/project/metabang-bind/ 

metabang-bind is also ASDF installable. Its CLiki home is right where you'd expect.

There's also a handy gzipped tar file.

What is happening

1 Dec 2007 - Added support for array destructuring (Thanks to Tamas Papp for the idea)

15 Nov 2007 - New user guide; bind handles structures and property lists and is now extensible!

13 Nov 2005 - Initial webpage n' stuff.