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

Sublists in Scheme/Racket

Name: Anonymous 2012-11-08 15:50

/prog/

What am I doing wrong here?

I'm supposed to make a Scheme/Racket function named "sublist?" that takes 2 lists of numbers. It is supposed to produce true if list1 is a sublist of list2 (in other words, list 2 contains list1) and false if its otherwise.

But this shit ain't working...

 (define (sublist? l1 l2)
  (cond ((null? l2) #t)
        ((not (exists l1 (car l2))) #f)
        (else (sublist? l1 (cdr l2)))))
 
 (define (exists l p)
  (if (null? l) #f
      (or (equal? p (car l)) (exists (cdr l) p))))

Name: Anonymous 2012-11-09 3:44

>>16

You remind me of the jews poster more and more everyday. The same use of quotations for mocking. Character assassination. Trying to find out details for a character to assassinate when the character is presented from behind the murks of an anonymous bbs. And ironically, you show the same bigotry as well. I'm reminded of neo and agent smith from the matrix.

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