title: combining two variables into one function name in macro
body: <p>I was toying around with macros and clos, where I created an "object" macro to create instances</p>
  
  <pre><code>(defmacro object (class &amp;rest args)
    `(make-instance ',class ,@args))
  </code></pre>
  
  <p>Now doing this, I also ended up kind of wanting to do something similar for accessor functions created by clos. Example:</p>
  
  <pre><code>(defclass person () ((name :accessor person-name :initarg :name)))
  </code></pre>
  
  <p>then creating the instance</p>
  
  <pre><code>(setf p1 (object person :name "tom"))
  </code></pre>
  
  <p>now to get the name from the object obviously I would call person-name, however just as with the object macro, I wanted to create a "gets" macro to do this. So ideally:</p>
  
  <pre><code>(gets person name p1) which then would return the name.
  </code></pre>
  
  <p>The problem then is the binding of person and name (person-name) and how to do that. Is there anyway to get those two arguments bound together in the macro? sort of like:</p>
  
  <pre><code>(defmacro gets (class var object)
    `(,class-,var ,object))
  </code></pre>