title: Checking a procedure reference for type?
body: <p>We are using scheme version r5rs trying to check a procedure pointer for the type it is pointing to.</p>
  
  <p>We've created a object using:</p>
  
  <pre><code>(define (%macro name exp env)
    (define (set-exp new_exp) (set! exp new_exp))
    (define (set-env new_env) (set! env new_env))
    (define (set-name new_name) (set! name new_name))
  
    (define (%dispatch call)
      (cond 
        ((eq? call 'get-exp) exp)
        ((eq? call 'get-env) env)
        ((eq? call 'get-name) name)
  
        ((eq? call 'set-exp) set-exp)
        ((eq? call 'set-env) set-env)
        ((eq? call 'set-name) set-name)
    ))
  
    %dispatch
  )
  </code></pre>
  
  <p>We then want to check a procedure reference to determine if it points to the dispatch function in another part of the code:</p>
  
  <pre><code>(define (macro? exp)
    (eq? %macro exp)
    )
  </code></pre>
  
  <p>This doesn't seem to work, how do we properly check the pointer if it points to a macro object (really the dispatch procedure)?</p>
  
  <p>Any help is greatly appreciated :)</p>