[racket] Running Racket in the R6RS mode

From: Rouben Rostamian (rostamian at umbc.edu)
Date: Sat Jul 14 00:51:35 EDT 2012

Here is the entire contents of a file named tryme.rkt:

(import (rnrs base)
        (rnrs sorting (6)))

I start up racket from the command-line (non-gui) and type:

(enter! "tryme.rkt")
(list-sort < '(4 2 7 1))  ; note: list-sort is from R6RS's sorting library

This produces:

     (mcons 1 (mcons 2 (mcons 4 (mcons 7 '()))))

Is there a way to get a plain (1 2 4 7) representation?

Aside: My objective here is to limit Racket to R6RS in the
hope that my code will be portable to other platforms that
implement R6RS.  If this is not the right way of going
about it, please let me know

Rouben Rostamian

Posted on the users mailing list.