- Code: Select all
(defmacro nlet ((&rest vars) &body body)
`(let ,(loop for var in vars collect `(,(first var) (#_new ,@(rest var))))
,@body))
Where #_ is the commonqt reader macro. Of course, it doesn't work.
So I've created cl-rttemplate which works in a similar way as quasiquoting, but in the read-time. Then the macro looks like this (for details go to the homepage of project):
- Code: Select all
(setf (readtable-case cl-rttemplate:*rt*) :preserve)
(defmacro nlet ((&rest vars) &body body)
`(let ,(loop for var in vars collect `(,(first var) #"(#_new " #@',(rest var) ")"#))
,@body))
So what do you think about it? Or would you have a better solution?
