j14i/cl-macros huggingface dataset:
You are a Common Lisp macro expert. Given this code pattern:
(integer-writer 1)

Write a macro that addresses: Macro call that should be transformed by integer-writer

Macro definition:
(defmacro integer-writer (bytes)
  "Create a function to write integers to a binary stream."
  (let ((bits (* 8 bytes)))
    `(progn
       (declaim (inline ,(integer-writer-name bytes t)
                        ,(integer-writer-name bytes nil)))
       (defun ,(integer-writer-name bytes nil) (socket value)
         (declare (type stream socket)
                  (type (unsigned-byte ,bits) value)
                  #.*optimize*)
         ,@(if (= bytes 1)
               `((write-byte value socket))
               (loop :for byte :from (1- bytes) :downto 0
                     :collect `(write-byte (ldb (byte 8 ,(* byte 8)) value)
                                           socket)))
         (values))
       (defun ,(integer-writer-name bytes t) (socket value)
         (declare (type stream socket)
                  (type (signed-byte ,bits) value)
                  #.*optimize*)
         ,@(if (= bytes 1)
               `((write-byte (ldb (byte 8 0) value) socket))
               (loop :for byte :from (1- bytes) :downto 0
                     :collect `(write-byte (ldb (byte 8 ,(* byte 8)) value)
                                           socket)))
         (values)))))

Macroexpansion:
(progn (declaim (inline write-int1 write-uint1)) (defun write-uint1 (socket value) (declare (type stream socket) (type (unsigned-byte 8) value) (optimize (speed 3) (safety 0) (space 1) (debug 1) (compilation-speed 0))) (write-byte value socket) (values)) (defun write-int1 (socket value) (declare (type stream socket) (type (signed-byte 8) value) (optimize (speed 3) (safety 0) (space 1) (debug 1) (compilation-speed 0))) (write-byte (ldb (byte 8 0) value) socket) (values)))
Write a Common Lisp macro to handle this code pattern:
(with-lock (lru-pool-lock pool) (evict-tail pool))

Problem: Macro call that should be transformed by with-lock

Macro definition:
(defmacro with-lock (lock &body body)
  (declare (ignorable lock))
  #+thread-support `(bt2:with-lock-held (,lock)
                      ,@body)
  #-thread-support `(progn ,@body))

Macroexpansion:
(bt2:with-lock-held ((lru-pool-lock pool)) (evict-tail pool))
You are a Common Lisp macro expert. Given this code pattern:
(with-active-layers* nil
  :key
  nil)

Write a macro that addresses: Macro call that should be transformed by WITH-ACTIVE-LAYERS*

Macro definition:
(defmacro WITH-ACTIVE-LAYERS* ...)

Macroexpansion:
(progn :key nil)
Create a Common Lisp macro for the following transformation. Before code:
(ematch0 args (nil nil) ((list* '&key rest) (list* '&key (process-keyword-args rest))) ((list* '&aux rest) args) ((list* name rest) (list* name (process-rest-args rest))))

What needs to change: Macro call that should be transformed by ematch0

Macro definition:
(defmacro ematch0 (what &body clauses)
  `(match0 ,what
     ,@clauses
     (_ (error "level0 match error!"))))

Macroexpansion:
(match0 args (nil nil) ((list* (quote &key) rest) (list* (quote &key) (process-keyword-args rest))) ((list* (quote &aux) rest) args) ((list* name rest) (list* name (process-rest-args rest))) (_ (error "level0 match error!")))
Create a Common Lisp macro for the following transformation. Before code:
(with-env (setp 2 [plist :c]))

What needs to change: Macro call that should be transformed by with-env

Macro definition:
(defmacro with-env (&body body)
  (let ((body-value (gensym)))
    `(let (,body-value)
       (defclass foo () ((a :initform 3)))
       (defmethod get-val ((object foo) &rest slot/s) (slot-value object (car slot/s)))
       (defmethod (setf get-val) (new-value (object foo) &rest slot/s)
         (setf (slot-value object (car slot/s)) new-value))
       (defstruct bar a)
       (setq ,body-value
             (let ((str (alexandria:copy-array "abcde"))
                   (vec (alexandria:copy-array #(a b c d e)))
                   (arr (alexandria:copy-array #2A((1 2 3)
                                                   (4 5 6))))
                   (list      (copy-list '(a b c d e)))
                   (ht        (eval (read-from-string "{'a 'b 'c 'd}")))
                   (ht-eq     (eval (read-from-string "{eq \"a\" 1
                                                    \"b\" 2}")))
                   (ht-equalp (eval (read-from-string "{equalp '(1 2 3) \"a\"
                                                               '(4 5 6) \"b\"}")))
                   (assoc-list (copy-tree '((a . 1) (b . 2))))
                   (plist      (copy-list '(:a 4 :c 5)))
                   (clos-object (make-instance 'foo))
                   (struct      (make-bar :a 3)))
               (declare (ignorable str vec arr list ht ht-eq ht-equalp
                                   assoc-list plist clos-object struct))
               ,@body))
       (setf (find-class 'foo nil) nil)
       (setf (find-class 'bar nil) nil)
       ,body-value))

Macroexpansion:
(let (#:g136) (defclass foo nil ((a :initform 3))) (defmethod get-val ((object foo) &rest slot/s) (slot-value object (car slot/s))) (defmethod (setf get-val) (new-value (object foo) &rest slot/s) (setf (slot-value object (car slot/s)) new-value)) (defstruct bar a) (setq #:g136 (let ((str (alexandria:copy-array "abcde")) (vec (alexandria:copy-array #(a b c d e))) (arr (alexandria:copy-array #2A((1 2 3) (4 5 6)))) (list (copy-list (quote (a b c d e)))) (ht (eval (read-from-string "{'a 'b 'c 'd}"))) (ht-eq (eval (read-from-string "{eq \"a\" 1
                                                    \"b\" 2}"))) (ht-equalp (eval (read-from-string "{equalp '(1 2 3) \"a\"
                                                               '(4 5 6) \"b\"}"))) (assoc-list (copy-tree (quote ((a . 1) (b . 2))))) (plist (copy-list (quote (:a 4 :c 5)))) (clos-object (make-instance (quote foo))) (struct (make-bar :a 3))) (declare (ignorable str vec arr list ht ht-eq ht-equalp assoc-list plist clos-object struct)) (setp 2 [plist :c]))) (setf (find-class (quote foo) nil) nil) (setf (find-class (quote bar) nil) nil) #:g136)
Create a Common Lisp macro for the following transformation. Before code:
(define-simple-type-map compiler-macro cl:compiler-macro)

What needs to change: Macro call that should be transformed by define-simple-type-map

Macro definition:
(defmacro define-simple-type-map (class type)
  `(defmethod type ((,class ,class))
     ',type))

Macroexpansion:
(defmethod type ((compiler-macro compiler-macro)) (quote common-lisp:compiler-macro))
You are a Common Lisp macro expert. Given this code pattern:
(with-generator 'some-name)

Write a macro that addresses: Macro call that should be transformed by WITH-GENERATOR

Macro definition:
(defmacro WITH-GENERATOR ...)

Macroexpansion:
(let ((quote some-name))
  (assert (typep quote 'generator!))
  (unwind-protect (progn) (stop quote)))
Write a Common Lisp macro to handle this code pattern:
(defun/1 atan2 (x y) (atan x y))

Problem: Macro call that should be transformed by defun/1

Macro definition:
(defmacro defun/1 (name arglist &body body)
  "Lisp-1 defun; makes function pointers work."
  `(progn
     (defun ,name ,arglist
       (declare (optimize (speed 0) (debug 3)
                          ;; FIXME: Why do minor warnings result in load errors?
                          #+sbcl (sb-ext:inhibit-warnings 3)))
        
       ,@body)
     (defparameter ,name (vacietis.c:mkptr& (symbol-function ',name)))))

Macroexpansion:
(progn (defun atan2 (x y) (declare (optimize (speed 0) (debug 3) (sb-ext:inhibit-warnings 3))) (atan x y)) (defparameter atan2 (vacietis.c:mkptr& (symbol-function (quote atan2)))))
Define a macro that eliminates this repetitive pattern:
(signal-reader-error "No character for char-code #x~X" code)

Issue: Macro call that should be transformed by signal-reader-error

Macro definition:
(defmacro signal-reader-error (format-control &rest format-arguments)
  "Like ERROR but signals a SIMPLE-READER-ERROR for the stream
*STREAM*."
  `(error 'simple-reader-error
          :stream *stream*
          :format-control ,format-control
          :format-arguments (list ,@format-arguments)))

Macroexpansion:
(error (quote simple-reader-error) :stream *stream* :format-control "No character for char-code #x~X" :format-arguments (list code))
Create a Common Lisp macro for the following transformation. Before code:
(expand-selector selector)

What needs to change: Macro call that should be transformed by expand-selector

Macro definition:
(defmacro expand-selector (&rest args)
  `(let ((result ,@args))
     (cond ((typep result 'kv-container) result)
	   ((typep result 'pair)         result)
	   ((null result)                result)
	   (t ($+ result)))))

Macroexpansion:
(let ((result selector)) (cond ((typep result (quote kv-container)) result) ((typep result (quote pair)) result) ((null result) result) (t ($+ result))))
You are a Common Lisp macro expert. Given this code pattern:
(define-simple-definition-resolver method-combination (designator) (find-method #'sb-mop:find-method-combination nil (list (find-class 'cl:generic-function) `(eql ,designator) T) nil))

Write a macro that addresses: Macro call that should be transformed by define-simple-definition-resolver

Macro definition:
(defmacro define-simple-definition-resolver (class lookup-function &body body)
  (let ((package (gensym "PACKAGE")))
    `(define-definition-resolver ,class (,class ,package)
       (when (ignore-errors ,(if body
                                 `(let ((,(first lookup-function) ,class))
                                    ,@body)
                                 `(,lookup-function ,class)))
         (list (make-instance ',class :designator ,class :package ,package))))))

Macroexpansion:
(define-definition-resolver method-combination (method-combination #:package143) (when (ignore-errors (let ((designator method-combination)) (find-method (common-lisp:function sb-mop:find-method-combination) nil (list (find-class (quote common-lisp:generic-function)) (sb-int:quasiquote (eql #S(sb-impl::comma :expr designator :kind 0))) t) nil))) (list (make-instance (quote method-combination) :designator method-combination :package #:package143))))
Define a macro that eliminates this repetitive pattern:
(define-simple-definition-resolver vop (designator) (sb-c::vop-parse-or-lose designator))

Issue: Macro call that should be transformed by define-simple-definition-resolver

Macro definition:
(defmacro define-simple-definition-resolver (class lookup-function &body body)
  (let ((package (gensym "PACKAGE")))
    `(define-definition-resolver ,class (,class ,package)
       (when (ignore-errors ,(if body
                                 `(let ((,(first lookup-function) ,class))
                                    ,@body)
                                 `(,lookup-function ,class)))
         (list (make-instance ',class :designator ,class :package ,package))))))

Macroexpansion:
(define-definition-resolver vop (vop #:package150) (when (ignore-errors (let ((designator vop)) (sb-c::vop-parse-or-lose designator))) (list (make-instance (quote vop) :designator vop :package #:package150))))
Write a Common Lisp macro to handle this code pattern:
(define-custom-var (:array-element *array-element-handler*))

Problem: Macro call that should be transformed by define-custom-var

Macro definition:
(defmacro define-custom-var ((key name) &rest other-args)
  `(eval-when (:compile-toplevel :load-toplevel :execute)
     (progn (pushnew '(,name . ,key) *custom-vars* :test #'equal)
            (defvar ,name ,@other-args))))

Macroexpansion:
(eval-when (:compile-toplevel :load-toplevel :execute) (progn (pushnew (quote (*array-element-handler* . :array-element)) *custom-vars* :test (function equal)) (defvar *array-element-handler*)))
You are a Common Lisp macro expert. Given this code pattern:
(with-symbol-access
  nil)

Write a macro that addresses: Macro call that should be transformed by WITH-SYMBOL-ACCESS

Macro definition:
(defmacro WITH-SYMBOL-ACCESS ...)

Macroexpansion:
(let ((*symbol-access* t))
  nil)
Create a Common Lisp macro for the following transformation. Before code:
($)

What needs to change: Macro call that should be transformed by $

Macro definition:
(defmacro $ ...)

Macroexpansion:
nil
You are a Common Lisp macro expert. Given this code pattern:
(set-custom-vars :integer #'parse-number :real #'parse-number :boolean #'json-boolean-to-lisp :beginning-of-array #'init-accumulator :array-member #'accumulator-add :end-of-array #'accumulator-get-sequence :array-type 'vector :beginning-of-object #'init-accumulator-and-prototype :object-key #'accumulator-add-key-or-set-prototype :object-value #'accumulator-add-value-or-set-prototype :end-of-object #'accumulator-get-object :beginning-of-string #'init-string-stream-accumulator :string-char #'string-stream-accumulator-add :end-of-string #'string-stream-accumulator-get :aggregate-scope (union *aggregate-scope-variables* '(*accumulator* *accumulator-last*)) :object-scope (union *object-scope-variables* '(*prototype* *json-array-type*)) :internal-decoder #'decode-json)

Write a macro that addresses: Macro call that should be transformed by set-custom-vars

Macro definition:
(defmacro set-custom-vars (&rest key-args)
  `(setq
    ,@(loop for (supplied-key value) on key-args by #'cddr
         append (loop for (var . var-key) in *custom-vars*
                   thereis (if (eql var-key supplied-key)
                               (list var value))))))

Macroexpansion:
(setq *integer-handler* (function parse-number) *real-handler* (function parse-number) *boolean-handler* (function json-boolean-to-lisp) *beginning-of-array-handler* (function init-accumulator) *array-member-handler* (function accumulator-add) *end-of-array-handler* (function accumulator-get-sequence) *json-array-type* (quote vector) *beginning-of-object-handler* (function init-accumulator-and-prototype) *object-key-handler* (function accumulator-add-key-or-set-prototype) *object-value-handler* (function accumulator-add-value-or-set-prototype) *end-of-object-handler* (function accumulator-get-object) *beginning-of-string-handler* (function init-string-stream-accumulator) *string-char-handler* (function string-stream-accumulator-add) *end-of-string-handler* (function string-stream-accumulator-get) *aggregate-scope-variables* (union *aggregate-scope-variables* (quote (*accumulator* *accumulator-last*))) *object-scope-variables* (union *object-scope-variables* (quote (*prototype* *json-array-type*))) *internal-decoder* (function decode-json))
You are a Common Lisp macro expert. Given this code pattern:
(unroll-assignment-ops += -= *= /= %= <<= >>= &= ^= |\|=|)

Write a macro that addresses: Macro call that should be transformed by unroll-assignment-ops

Macro definition:
(defmacro unroll-assignment-ops (&rest ops)
  `(progn
     ,@(loop for op in ops collect
            `(defmacro ,(find-symbol (symbol-name op) '#:vacietis.c)
                 (lvalue rvalue)
               `(setf ,lvalue
                      (,',(find-symbol
                           (reverse (subseq (reverse (symbol-name op)) 1))
                           '#:vacietis.c)
                          ,lvalue
                          ,rvalue))))))

Macroexpansion:
(progn (defmacro vacietis.c:+= (lvalue rvalue) (sb-int:quasiquote (setf #S(sb-impl::comma :expr lvalue :kind 0) (#S(sb-impl::comma :expr (quote vacietis.c:+) :kind 0) #S(sb-impl::comma :expr lvalue :kind 0) #S(sb-impl::comma :expr rvalue :kind 0))))) (defmacro vacietis.c:-= (lvalue rvalue) (sb-int:quasiquote (setf #S(sb-impl::comma :expr lvalue :kind 0) (#S(sb-impl::comma :expr (quote vacietis.c:-) :kind 0) #S(sb-impl::comma :expr lvalue :kind 0) #S(sb-impl::comma :expr rvalue :kind 0))))) (defmacro vacietis.c:*= (lvalue rvalue) (sb-int:quasiquote (setf #S(sb-impl::comma :expr lvalue :kind 0) (#S(sb-impl::comma :expr (quote vacietis.c:*) :kind 0) #S(sb-impl::comma :expr lvalue :kind 0) #S(sb-impl::comma :expr rvalue :kind 0))))) (defmacro vacietis.c:/= (lvalue rvalue) (sb-int:quasiquote (setf #S(sb-impl::comma :expr lvalue :kind 0) (#S(sb-impl::comma :expr (quote vacietis.c:/) :kind 0) #S(sb-impl::comma :expr lvalue :kind 0) #S(sb-impl::comma :expr rvalue :kind 0))))) (defmacro vacietis.c:%= (lvalue rvalue) (sb-int:quasiquote (setf #S(sb-impl::comma :expr lvalue :kind 0) (#S(sb-impl::comma :expr (quote vacietis.c:%) :kind 0) #S(sb-impl::comma :expr lvalue :kind 0) #S(sb-impl::comma :expr rvalue :kind 0))))) (defmacro vacietis.c:<<= (lvalue rvalue) (sb-int:quasiquote (setf #S(sb-impl::comma :expr lvalue :kind 0) (#S(sb-impl::comma :expr (quote vacietis.c:<<) :kind 0) #S(sb-impl::comma :expr lvalue :kind 0) #S(sb-impl::comma :expr rvalue :kind 0))))) (defmacro vacietis.c:>>= (lvalue rvalue) (sb-int:quasiquote (setf #S(sb-impl::comma :expr lvalue :kind 0) (#S(sb-impl::comma :expr (quote vacietis.c:>>) :kind 0) #S(sb-impl::comma :expr lvalue :kind 0) #S(sb-impl::comma :expr rvalue :kind 0))))) (defmacro vacietis.c:&= (lvalue rvalue) (sb-int:quasiquote (setf #S(sb-impl::comma :expr lvalue :kind 0) (#S(sb-impl::comma :expr (quote vacietis.c:&) :kind 0) #S(sb-impl::comma :expr lvalue :kind 0) #S(sb-impl::comma :expr rvalue :kind 0))))) (defmacro vacietis.c:^= (lvalue rvalue) (sb-int:quasiquote (setf #S(sb-impl::comma :expr lvalue :kind 0) (#S(sb-impl::comma :expr (quote vacietis.c:^) :kind 0) #S(sb-impl::comma :expr lvalue :kind 0) #S(sb-impl::comma :expr rvalue :kind 0))))) (defmacro vacietis.c:|\|=| (lvalue rvalue) (sb-int:quasiquote (setf #S(sb-impl::comma :expr lvalue :kind 0) (#S(sb-impl::comma :expr (quote vacietis.c:|\||) :kind 0) #S(sb-impl::comma :expr lvalue :kind 0) #S(sb-impl::comma :expr rvalue :kind 0))))))
Write a Common Lisp macro to handle this code pattern:
(check-cursor-attached cluffer:item-after-cursor (cursor))

Problem: Macro call that should be transformed by check-cursor-attached

Macro definition:
(defmacro check-cursor-attached (name arguments)
  (let ((args (substitute '(cursor cluffer:cursor) 'cursor arguments)))
    `(defmethod ,name :before ,args
       (declare (ignore ,@(set-difference (remove 'cursor arguments)
                                          lambda-list-keywords)))
       (unless (cluffer:cursor-attached-p cursor)
         (error 'cluffer:cursor-detached)))))

Macroexpansion:
(defmethod cluffer:item-after-cursor :before ((cursor cluffer:cursor)) (declare (ignore)) (unless (cluffer:cursor-attached-p cursor) (error (quote cluffer:cursor-detached))))
Create a Common Lisp macro for the following transformation. Before code:
(define-simple-clause always (form &aux (result T)) (values `(unless ,form (setf ,result NIL) (end-for)) result))

What needs to change: Macro call that should be transformed by define-simple-clause

Macro definition:
(defmacro define-simple-clause (name args &body body)
  (multiple-value-bind (args outer-let inner-let result-let) (compute-binding-parts NIL NIL args)
    `(define-direct-clause ,name ,(rest args)
       (let ,outer-let
         (values* `(let* ,(list
                           ,@result-let)
                     (declare (ignorable ,,@(mapcar #'delist outer-let))))
                  (let ,inner-let
                    (declare (ignorable ,@(mapcar #'delist inner-let)))
                    ,@body))))))

Macroexpansion:
(define-direct-clause always (form) (let ((#:result185 (gensym #A((6) base-char . "RESULT")))) (values* (sb-int:quasiquote (let* #S(sb-impl::comma :expr (list (list #:result185 (quote t))) :kind 0) (declare (ignorable #S(sb-impl::comma :expr #:result185 :kind 0))))) (let ((result #:result185)) (declare (ignorable result)) (values (sb-int:quasiquote (unless #S(sb-impl::comma :expr form :kind 0) (setf #S(sb-impl::comma :expr result :kind 0) nil) (end-for))) result)))))
Define a macro that eliminates this repetitive pattern:
(with-unique-js-names)

Issue: Macro call that should be transformed by WITH-UNIQUE-JS-NAMES

Macro definition:
(defmacro WITH-UNIQUE-JS-NAMES ...)

Macroexpansion:
(with-ps-gensyms)
Write a Common Lisp macro to handle this code pattern:
(with-collectors nil)

Problem: Macro call that should be transformed by WITH-COLLECTORS

Macro definition:
(defmacro WITH-COLLECTORS ...)

Macroexpansion:
(progn)
Write a Common Lisp macro to handle this code pattern:
(the-part 'some-name)

Problem: Macro call that should be transformed by THE-PART

Macro definition:
(defmacro THE-PART ...)

Macroexpansion:
(send part 'some-name)
Generate a defmacro form that transforms code like this:
(letmatch nil
    (progn))

Pattern to recognize: Macro call that should be transformed by LETMATCH

Macro definition:
(defmacro LETMATCH ...)

Macroexpansion:
(ifmatch (nil (progn) nil (error "LETMATCH:  mismatch.")))
Write a Common Lisp macro to handle this code pattern:
(defaction nil
    nil)

Problem: Macro call that should be transformed by DEFACTION

Macro definition:
(defmacro DEFACTION ...)

Macroexpansion:
(setf (gethash #A((3) base-char . "NIL") cl-rules.core::*actions*) (lambda ()))
Write a Common Lisp macro to handle this code pattern:
(js-inline nil (progn))

Problem: Macro call that should be transformed by JS-INLINE

Macro definition:
(defmacro JS-INLINE ...)

Macroexpansion:
(js-inline* '(progn nil (progn)))
Generate a defmacro form that transforms code like this:
(with-color (:yellow :stream stream) (format/indent reporter stream "△ Tests were run but no plan was declared.~%"))

Pattern to recognize: Macro call that should be transformed by with-color

Macro definition:
(defmacro with-color ((color &rest args) &body body)
  (cond
    ((or (eq color :gray)
         (eq color :grey))
     `(if *enable-colors*
          (with-gray ,(or (getf args :stream) t) ,@body)
          (progn ,@body)))
    (T `(if *enable-colors*
            (if (or (eq ,color :gray)
                    (eq ,color :grey)
                    (eq ,color cl-colors:+gray+)
                    (eq ,color cl-colors:+grey+))
                (with-gray ,(or (getf args :stream) t) ,@body)
                (cl-ansi-text:with-color (,color ,@args) ,@body))
            (progn ,@body)))))

Macroexpansion:
(if *enable-colors* (if (or (eq :yellow :gray) (eq :yellow :grey) (eq :yellow +gray+) (eq :yellow +grey+)) (with-gray stream (format/indent reporter stream "△ Tests were run but no plan was declared.~%")) (cl-ansi-text:with-color (:yellow :stream stream) (format/indent reporter stream "△ Tests were run but no plan was declared.~%"))) (progn (format/indent reporter stream "△ Tests were run but no plan was declared.~%")))
Write a Common Lisp macro to handle this code pattern:
(defpattern nil
    nil)

Problem: Macro call that should be transformed by DEFPATTERN

Macro definition:
(defmacro DEFPATTERN ...)

Macroexpansion:
(eval-always
  (setf (get 'nil 'cl-match-pattern)
          (lambda (#:g133)
            (lett nil
                #:g133))))
Create a Common Lisp macro for the following transformation. Before code:
(ltbdd-with-new-hash nil)

What needs to change: Macro call that should be transformed by LTBDD-WITH-NEW-HASH

Macro definition:
(defmacro LTBDD-WITH-NEW-HASH ...)

Macroexpansion:
(bdd-call-with-new-hash (lambda ()) :bdd-node-type
                        '(or lisp-type-bdd-node bdd-leaf))
You are a Common Lisp macro expert. Given this code pattern:
(->>
  nil
  nil)

Write a macro that addresses: Macro call that should be transformed by ->>

Macro definition:
(defmacro ->> ...)

Macroexpansion:
(let* ((#:var183 nil) (#:var184 (nil #:var183)))
  #:var184)
Generate a defmacro form that transforms code like this:
(define-path-instruction-pair smooth-curve-to "S" (control-x2 control-y2 x y))

Pattern to recognize: Macro call that should be transformed by define-path-instruction-pair

Macro definition:
(defmacro define-path-instruction-pair (name instruction (&rest args))
  (let ((draw-relative (intern (concatenate 'string (string name) "-R"))))
    `(progn
       (defun ,name (,@args)
         (format-instruction ,instruction ,@args))
       (defun ,draw-relative (,@args)
         (format-instruction ,(string-downcase instruction) ,@args)))))

Macroexpansion:
(progn (defun smooth-curve-to (control-x2 control-y2 x y) (format-instruction "S" control-x2 control-y2 x y)) (defun smooth-curve-to-r (control-x2 control-y2 x y) (format-instruction "s" control-x2 control-y2 x y)))