[racket] beginner's question on learning Scheme

From: Eli Barzilay (eli at barzilay.org)
Date: Wed Aug 25 11:53:26 EDT 2010

On Aug 25, Jim Wise wrote:
> Matthias Felleisen <matthias at ccs.neu.edu> writes:
> 
> > Open DrRacket, choose Language, click radio button "Use the language
> > declared in the source", type
> >
> > #lang r6rs
> 
> Once you do this, IIRC, all of the examples in TSPL4 work in
> DrRacket except for those that use set-car! and set-cdr!, since
> Racket (by design) does not allow mutable pairs.

In the r6rs language you get the mutable pairs by default:

  #!r6rs
  
  (import (rnrs) (rnrs mutable-pairs))
  
  (write (let ([x (list 'a 'b 'c)])
           (set-car! x 1)
           x))

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!


Posted on the users mailing list.