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

From: Andreas Rottmann (a.rottmann at gmx.at)
Date: Mon Dec 14 15:20:27 EST 2009


[ This is a re-send of my mail from 3rd December
  (http://thread.gmane.org/gmane.lisp.scheme.plt/37267), I thought I'd
  retry in case the initial mail has been overlooked by the PLT R6RS
  Gurus ]

Regarding the R6RS SRFIs, I just noticed that SRFI-67 needs a separate
R6RS version as well. 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

The relevant code:

(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 dev mailing list.