Re: Lisp syntax vs. Mathematica syntax



Jon Harrop wrote:

Here's my puny attempt at a Lisp conversion that only works for
single-argument functions:

  (defmacro mapply (`f `(g arg))
    `(,f ,arg))


Your macro is wrong, here is a corrected version and a multi-arg version

(defmacro mapply (f (g arg))
  (declare (ignore g))
  `(,f ,arg))

(defmacro mapply (f (g &rest args))
  (declare (ignore g))
  `(,f ,@args))

CL-USER 2 > (mapply + (g 3 10))
13

CL-USER 3 >


Wade .