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: Anonymous 2009-07-24 21:35

>>80
( ≖‿≖)

Name: Anonymous 2009-07-25 4:44

>>80
Daddy, I am a side-effect?

Name: Anonymous 2009-07-25 5:41

PUBLIC SERVICE ANNOUNCEMENT:

20721 IS NOT BEING CRAPFLOODED

Name: Anonymous 2009-07-25 5:47

Be Safe! Use a Monad!

Name: Anonymous 2009-07-25 12:51

>>82
I almost lol'd.

Name: Scheme Noobie 2009-07-26 0:41

Wow, this is a great series. It really has opened my eyes to things I did not understand. I feel very comfortable with recursion now. I am going to watch 2b and return to writing scheme code. Thanks guys.

Name: Scheme Noobie 2009-07-27 1:21

Working through The Little Schemer again after watching those videos. I am good with recursion on a flat list but nested lists are a challenge. I am going to keep programming in Scheme until I am good at it and maybe move to Lisp or Haskell. I like Scheme.

Name: Anonymous 2009-07-27 2:03

>>87
maybe move to Lisp
Common Lisp and Scheme are both forms of Lisp. Please don't call CL "Lisp" to differentiate it from Scheme. The original Lisp was more like Scheme than like CL anyway.

Name: Anonymous 2009-07-27 2:07

>>87
It's good to have a type system to keep you from getting lost in the depths of car and cdr

Name: Anonymous 2009-07-27 4:47

>>89
He will probably understand lists much better after finishing Little Schemer and SICP, and I don't think he'll get lost if he truly understands all the implications. Having a strong inferrence-based type system is nice to some degree, as it means safer and faster(at less cost to clarity than in lisp) programs, but it can also get in your way unnecesarily, but don't get me wrong, Haskell is a very good language with many strengths, although different from dynamic languages like Lisp.

I think it's a good idea to learn CL now that he knows Scheme, as it's a more practical language, not that Scheme isn't practical, but Scheme was designed with theorethical beauty and language cleanliness in mind, while Common Lisp was made with pratical issues in mind and writing larger real world programs, and thus is a much larger language. This doesn't mean you'll find all kinds of crap that gets placed in the Java or .NET libraries. CL's functions/macros, even though many in number, are meant to make general programming easier/faster/more efficient, not to give easy solutions to the trendy problems of today, however CL is a programmable programming language(in the sense that defining new operators(as functions or macros) is easy and encouraged), and surely solving modern problems isn't that hard, and there's many user-made libraries for those too.

Name: Anonymous 2009-07-27 15:12

>>88
The original Lisp was more like Scheme than like CL anyway.
Wat. It didn't even have lexical scoping or closures. And I'm pretty sure it didn't have unhygienic namespaces.

Name: Anonymous 2009-07-27 15:24

>>91
YHBT, >>88 is clearly a troll

Name: Anonymous 2009-07-27 16:27

>>92
I'm fucking your commonly

Name: Anonymous 2009-07-27 18:27

>>93
You're an idiot.

Name: Anonymous 2010-12-08 9:16

wat

Name: Anonymous 2010-12-08 9:16

wat

Name: Anonymous 2010-12-08 9:17

WAT?

Name: Anonymous 2010-12-08 9:18

WAT?

Name: Anonymous 2010-12-10 10:11

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