[plt-scheme] Using the `include' macro from R6RS code

From: Andreas Rottmann (a.rottmann at gmx.at)
Date: Fri Dec 4 07:15:06 EST 2009

Hi!

I just noticed that SRFI-67 needs a separate R6RS version as well; now I
see that there already is collects/srfi/67/compare-reference.scm, which
contains the reference implementation for SRFI-67. 

Ideally, I'd just include that file from an R6RS library, and I'm
done. But it seems that `include' from scheme/base doesn't work from
R6RS code, probably due to mutable pair issues:

/home/rotty/tmp/=plt-collects/srfi/%3a67.ss:24:11: include: not a
pathname string, `file' form, or `lib' form for file at: (lib
"srfi/67/compare-reference.scm") in: (include (lib
"srfi/67/compare-reference.scm"))

The relevant code:

#!r6rs
(library (srfi :67)
  (export  </<=? ...) 
  (import (except (rnrs base) error)
          (rnrs r5rs)    ; for modulo
          (srfi :27 random-bits)  ; for random-integer
          (srfi :23 error)
          (scheme include))
(include (lib "srfi/67/compare-reference.scm")))

So, how can I include a file from R6RS code, when the regular include
won't work?

Regards, Rotty
-- 
Andreas Rottmann -- <http://rotty.yi.org/>


Posted on the users mailing list.