I don't have a ton of experience with CL, so please bear with me 
As a helper to another macro I'm writing, I need a macro that is exactly like let, but evaluates its first argument (which should evaluate to a let list) and then drops it into a simple let expression.
This was my first attempt:
Then I tried this (not sure if this is proper use of eval-when or not...):
Help!
Thanks a lot,
_Nick_
As a helper to another macro I'm writing, I need a macro that is exactly like let, but evaluates its first argument (which should evaluate to a let list) and then drops it into a simple let expression.
This was my first attempt:
(defmacro eval-let (evals-to-let-list &body body)
`(let ,(eval evals-to-let-list)
,@body))
but thenCL-USER> (let ((foo '((bar 5))))
(eval-let foo
(* bar bar)))
Fails because "foo" is undefined at macroexpansion time.Then I tried this (not sure if this is proper use of eval-when or not...):
(defmacro eval-let (evals-to-let-list &body body)
`(let ,(eval-when (:execute) (eval evals-to-let-list))
,@body))
But the same thing happens.Help!
Thanks a lot,
_Nick_