[plt-scheme] syntax/module-reader and module specs

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Mon May 4 08:50:22 EDT 2009

Checkout what I do in the PLAI language:

(module reader syntax/module-reader
  #:language `(planet ,(this-package-version-symbol))
  (require (planet cce/scheme:4:1/planet)))

http://planet.plt-scheme.org/package-source/plai/plai.plt/1/1/lang/reader.ss

On Mon, May 4, 2009 at 2:27 AM, Neil Van Dyke <neil at neilvandyke.org> wrote:
> Is there a trick to getting the "#:language" in a "lang/reader.ss" to refer
> to a module in a file relative to "lang/reader.ss", such as "require" can do
> with module-specs?
>
> When I attempt to use a string or a "(file ...)" form, it resolves the
> filename relative to the directory from which DrScheme was started(?), not
> from relative to "lang/reader.ss".
>
> I would like this to work with both PLaneT and non-PLaneT collections, so
> the below example doesn't work.
>
>
> #lang s-exp syntax/module-reader
>
> ;; TODO: !!! This is not correct, since we are always require-ing a PLaneT
> ;; package, and without specifying version, regardless of whether or not
> this
> ;; implementation is actually coming from PLaneT.
> #:language '(planet "main.ss" ("me" "foo.plt"))
>
> #:wrapper1 (lambda (proc)
>            (parameterize ((read-accept-infix-dot        #f)
>                           (read-case-sensitive          #f)
>                           (read-curly-brace-as-paren    #f)
>                           (read-square-bracket-as-paren #f))
>              (proc)))
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>



-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://teammccarthy.org/jay

"The glory of God is Intelligence" - D&C 93


Posted on the users mailing list.