Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

The Little Schemer

Name: Anonymous 2009-07-19 23:23

Hi, I am working through the little schemer. I do not have the math skills to work through SICP.

I have the following code:


(define (member? a lat)
  (lambda (a lat)
    (cond
      ((null? lat) #f)
      (else (or (eq? (car lat) a)
                (member? a (cdr lat)))))))



When I run this say like:
(member? 3 (cons 3 '(9 8 7 6 13 3)))

I get the following:
#<procedure:...my-scheme-log.ss:137:2>
rather than a list without the first instance of 3

Can you help me?

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-07-23 4:38

Scheme Noobie, get a free C compiler instead of wasting time with Scheme( recc. http://en.wikipedia.org/wiki/Tiny_C_Compiler
You are far likely to understand C then any functional language.



_____________________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
A free press is not a privilege but an organic necessity in a great society. Without criticism and reliable and intelligent reporting, the government cannot govern. For there is no adequate way in which it can keep itself informed about what the people of the country are thinking and doing and wanting.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List