A lightweight `bind' macro
In my recent work I found myself writing a lot of code that looked like the following:
The above example is a bit contrived, for effect, but hopefully conveys the general idea.
What I wanted was a Clojure style `let' which could destructure inline. There was one Common Lisp implementation (http://common-lisp.net/project/metabang-bind/), which had some nice features, but it was bit much for my needs. So I came up with my own lightweight `bind' macro (see below), which lets me rewrite the above example as:
Way better, IMHO.
Oh, here's the `bind' macro in its entirety: