From: John Lewis
Subject: macro which defuns ?
Date: 
Message-ID: <1992Dec11.053800.2936@research.nj.nec.com>
I am trying to use a macro to defun some sterotyped routines,
parameterized by an arithmetic operator (see below).
This appears to work in some lisps, but it seems to
cause problems (including coredumps while compiling) in others.

I'm a novice at compiling and macros. Should this work or not work? 

(defmacro v-makeop (name op a b)
  `(defun ,(intern (concatenate 'string "V-" (symbol-name name)))
     (,a ,b)
     (let* ((len (length ,a))
	    (result (make-array len)))

       (dotimes (i len)
		 (setf (aref result i) (,op (aref ,a i) (aref ,b i))))
     result)
   )
);v-makeop


(v-makeop * * a b)  ;-> (defun v-* (a b) ... (* (aref a i) (aref b i)))