Created
September 30, 2013 16:56
-
-
Save josephwilk/6766732 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro pandoriclet (letargs &rest body) | |
(let [letargs (cons '(this) (let-binding-transform letargs))] | |
`(let (,@letargs) | |
(setq this ,@(last body)) | |
,@(butlast body) | |
(dlambda | |
(:pandoric-get (sym) | |
,(pandoriclet-get letargs)) | |
(:pandoric-set (sym val) | |
,(pandoriclet-set letargs)) | |
(t (&rest args) | |
(apply this args)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment