instead of
(qq a (uq b) (uq c))
you would rather like to write
(make-macro (a b c)) and this could simply be done with mfor
(qq mfor b ((uq b))
(mfor c ((uq c))
(a b c)))
this is useful if there are only a few variables, that would be unquotet, but are often used inside the macro, like in some macro I used, where I don't want to write (uq …) for each variable (see end of this comment)
but when there are many variables, this will get complicated, so something like
(make-macro list-of-variables ...body) would be more clear in such cases, where list-of-variables would be similar to a list in let
;;part of my macro
(qq mfor T (uq types)
(mfor N (uq nums)
(implement BasicMath T)
(instantiate Array T N)
(instantiate basic-math (Array T N))
(def dot (fn intern T ((x (Array T N)) (y (Array T N)))
(+ (* (@$ x 0) (@$ y 0)) (* (@$ x 1) (@$ y 1)))))
(instantiate Array T 3)
(instantiate Ball T N)
(instantiate collide (Ball T N))
(def-ptr-macro2 collide intern (Ball T N))
…))
instead of
(qq a (uq b) (uq c))
you would rather like to write(make-macro (a b c))
and this could simply be done with mforthis is useful if there are only a few variables, that would be unquotet, but are often used inside the macro, like in some macro I used, where I don't want to write
(uq …)
for each variable (see end of this comment)but when there are many variables, this will get complicated, so something like
(make-macro list-of-variables ...body)
would be more clear in such cases, wherelist-of-variables
would be similar to a list in let