title: member? function in racket
body: <p>I am following Brian Harvey's SICP lectures from 2011 on the <a href="http://webcast.berkeley.edu/playlist#c,d,Computer_Science,EC3E89002AA9B9879E" rel="noreferrer">UC Berkeley site</a>. He is using the <a href="http://kaolin.essi.fr/STk/" rel="noreferrer">STk interpreter</a> to teach the class and I am using racket with DrRacket to follow along. I am trying to define all of the functions he uses in the class that are not defined in racket (i.e. <code>word</code>, <code>butfirst</code>, <code>butlast</code>) for extra practice. </p>
  
  <p>I have run into an issue trying to define <code>member?</code>. He is able to use it on lists and strings, doing things like</p>
  
  
  
  <pre><code>(member? 1 (list 1 2 3 4)) ;; works
  (member? 'a '(a e i o u)) ;; works
  (member? 7 17) ;; doesn't work
  (member? #\e "Hello") ;; doesn't work
  </code></pre>
  
  <p>Here is my definition of <code>member?</code> for which the above do/don't work:</p>
  
  
  
  <pre><code>(define (member? u lst)
    (not (equal? (member u lst) #f)))
  </code></pre>
  
  <p>So this is working with a list, so the first two make sense that they are working. Is it even possible to create a function to mimic <code>member?</code> in STk? I was looking at the docs and it looks like strings, lists, non-negative integers and a bunch of other stuff are defined as <code>sequence</code> datatypes but I can't find a relevant sequence function.</p>