[plt-scheme] s-exp and custom reader

From: Sam TH (samth at ccs.neu.edu)
Date: Mon Jul 14 16:50:27 EDT 2008

It should be fairly easy to write a language like `s-exp' but where
the reader and the language are both specified.  Invocations would
look something like this:

#lang custom (lib "my-reader.ss") (lib "my-lang.ss")
..code goes here..

sam th

On Mon, Jul 14, 2008 at 4:34 PM, YC <yinso.chen at gmail.com> wrote:
>
> On Mon, Jul 14, 2008 at 1:13 PM, Anton Tayanovskyy
> <anton.tayanovskyy at gmail.com> wrote:
>>
>> From the manual:
>>
>> A sequence #lang 〈name〉 is equivalent to #reader 〈name〉/lang/reader
>>
>> http://docs.plt-scheme.org/reference/reader.html#(part._parse-reader)
>>
>> So you can use #lang instead of #reader.
>
> Yes - except `#lang` cannot handle all module spec such as `lib` or `planet`
> module path.  `s-exp` will use the next datum as the module path, but AFAICT
> `s-exp` doesn't allow the use of custom reader (which my custom language
> requires), and hence I ended up having to use #reader and hack my own s-exp
> module if I want to use `(planet ...)` as the module resolver.
>
>>
>> Not sure what your exact problem is, but I guess you can always hack
>> the s-exp/lang/reader.ss module to suit your needs, making, for
>> instance, a my-s-exp/lang/reader.ss module.
>
> That's what I did, thanks.  But in order to use `(planet ...)` path resolver
> - it appears I need to use `#reader` instead of `#lang`.  Hence I'm
> interesting in seeing `#lang` support more module specs.
>
> Thanks,
> yc
>
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
>



-- 
sam th
samth at ccs.neu.edu

Posted on the users mailing list.