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

Halp how do i programmed scheme

Name: Anonymous 2007-03-26 12:29 ID:e6O5XmtL

I'm trying to make a program that prints out the contents of a list.

     (define (dumplist list)
          (car list)
          (cond (null? (cdr list))
               (else
                    (dumplist (cdr list)))))

However, this doesn't work. Instead it just prints (cdr list)

Name: Anonymous 2007-03-30 2:50 ID:uVzRbC/a

>>17 is an idiot

(define (dumplist list)
   (if (atom? list)
        'list # this returns the symbol "list" not the value of list
        (dumplist (cdr list))  # you are stupid
   ) # these do not go here
) ; lisp uses fucking semi colon for a comment you moron.

god I am disgusted GTFO (read SICP and STFU)

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