title: How to test if two functions are the same?
body: <p>I found a code snippet <a href="https://github.com/yinwang0/lightsabers/blob/master/cps.ss">somewhere</a> online:</p>
  
  <pre><code>(letrec
    ([id (lambda (v) v)]
     [ctx0 (lambda (v) `(k ,v))]
           .....
           .....
           (if (memq ctx (list ctx0 id)) &lt;---- condition always return false
           .....
  </code></pre>
  
  <p>where ctx is also a function:</p>
  
  <p>However I could never make the test-statement return true.</p>
  
  <p>Then I have the following test:</p>
  
  <pre><code>(define ctx0 (lambda (v) `(k ,v)))
  (define ctx1 (lambda (v) `(k ,v)))
  (eq? ctx0 ctx1)
  =&gt; #f
  (eqv? ctx0 ctx1)
  =&gt; #f
  (equal? ctx0 ctx1)
  =&gt; #f
  </code></pre>
  
  <p>Which make me suspect that two function are always different since they have different memory location.</p>
  
  <p>But if functions can be compared against other functions, how can I test if two function are the same? and what if they have different variable name? for example:</p>
  
  <p><code>(lambda (x) (+ x 1))</code> and <code>(lambda (y) (+ y 1))</code></p>
  
  <p>P.S. I use DrRacket to test the code.</p>