I'm writing a program in which i have to reuse code from one of my professors. My program is written in Racket and the code i want to reuse is written in r6rs.
When I want to test my program it always fails. This is because I call a procedure with as argument a list (racket list), but that procedure is in the R6RS file. In the R6RS file there is
(assert (list? argument)) , this is always false...
Here a simple example : Racket code :
#lang racket (require "test2.ss") (define a (list 1 2 3)) (b a)
R6RS code :
#!r6rs (library (test) (export b) (import (rnrs base (6)) (rnrs control (6)) (rnrs lists (6)) (rnrs io simple (6))) (define (b a) (display "a is : ") (display a) (newline) (display "list? : ") (display (list? a)) (newline)))
list? test in the R6RS file is always false... even if I pass as argument a newly created list like in the above example.
How can I do the same as in the example above, so that the
list? tests results true.
Thanks for your help!
EDIT : I could not find a r6rs test that results in true on a immutable list, but I found another way to resolve my problem (by passing a mutable list to the procedure).