[plt-scheme] Re: list output

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Wed Apr 29 19:00:03 EDT 2009

Documentation for "append" is at:

Start up DrScheme, set the Language to Module, paste all of the code 
shown below into the top window, and hit the Run toolbar button.  I've 
added comments to this code to show the values that are displayed in the 
bottom window when you hit Run.

You can use DrScheme in this manner to test out what code does, whenever 
the documentation is unclear.

If this is frustrating, I think it's time to switch tracks to HtDP.  
HtDP is not intended to teach Scheme, but it happens to teach Scheme 
incidentally, and in a gentler way than skimming the R5RS document can.  

;;; ---- begin ----

#lang scheme/base

(define list1 '(a b c))
(define list2 '(x y z))

;; ==> (a b c)

;; ==> (x y z)

(append list1 list2)
;; ==> (a b c x y z)

;; ==> (a b c)

(set! list1 (append list1 list2))

;; ==> (a b c x y z)

;;; ---- end ----


Posted on the users mailing list.