Skip to main content
deleted 2 characters in body
Source Link

I want to make a macro for binding variables to values given a var-list and a val-list.

This is my code for it -

 (defmacro let-bind (vars vals &body body) `(let ,(loop for x in vars for y in vals collect `(,x ,y)) ,@body)) 

While it works correct if called like (let-bind '(a b) '(1 2) ...), it doesn't seem to work when called like

(defvar vars '(a b)) (defvar vals '(1 2)) (let-bind vars vals ..) 

Then I saw some effects for other of my macros too. I am a learner and cannot find what is wrong.

I want to make a macro for binding variables to values given a var-list and a val-list.

This is my code for it -

 (defmacro let-bind (vars vals &body body) `(let ,(loop for x in vars for y in vals collect `(,x ,y)) ,@body)) 

While it works correct if called like (let-bind '(a b) '(1 2) ...), it doesn't seem to work when called like

(defvar vars '(a b)) (defvar vals '(1 2)) (let-bind vars vals ..) 

Then I saw some effects for other of my macros too. I am a learner and cannot find what is wrong.

I want to make a macro for binding variables to values given a var-list and a val-list.

This is my code for it -

 (defmacro let-bind (vars vals &body body) `(let ,(loop for x in vars for y in vals collect `(,x ,y)) ,@body)) 

While it works correct if called like (let-bind (a b) (1 2) ...), it doesn't seem to work when called like

(defvar vars '(a b)) (defvar vals '(1 2)) (let-bind vars vals ..) 

Then I saw some effects for other of my macros too. I am a learner and cannot find what is wrong.

Source Link

Using special variables as macro input?

I want to make a macro for binding variables to values given a var-list and a val-list.

This is my code for it -

 (defmacro let-bind (vars vals &body body) `(let ,(loop for x in vars for y in vals collect `(,x ,y)) ,@body)) 

While it works correct if called like (let-bind '(a b) '(1 2) ...), it doesn't seem to work when called like

(defvar vars '(a b)) (defvar vals '(1 2)) (let-bind vars vals ..) 

Then I saw some effects for other of my macros too. I am a learner and cannot find what is wrong.