[racket] at-exp with module language

From: Scott Klarenbach (scott at pointyhat.ca)
Date: Sun Jan 12 13:27:18 EST 2014

Thanks Matthew.  That worked, but I don't fully understand why.  Is having
2 reader langs before the 3rd module lang unique to s-exp here, or is it
possible to chain multiple custom reader languages together like you've
done?

I assumed that #lang at-exp "my-lang.rkt" should work, since I'm wanting to
use at-exp syntax with "my-lang.rkt" semantics.  I'll keep digging and I'm
sure it will click.

Finally, as a quick pointer, is there a simple way to change #lang at-exp
s-exp "my-lang.rkt" into #lang my-lang?  Or if I want this, do I need to
implement my own reader that internally uses at-exp 's read-syntax and read
functions?

Thanks.


On Thu, Jan 9, 2014 at 6:57 PM, Matthew Flatt <mflatt at cs.utah.edu> wrote:

> You're right that `at-exp` isn't like `s-exp`, but you can use
>
>  #lang at-exp s-exp "my-lang.rkt"
>
>
> At Thu, 9 Jan 2014 18:00:44 -0800, Scott Klarenbach wrote:
> > I have a file that starts with:
> >
> > #lang at-exp racket/base
> >
> > I then have a bunch of require and init boilerplate that I'd like to move
> > out into a module language.  Using
> > http://docs.racket-lang.org/guide/module-languages.html as a rough
> guide, I
> > created a file and exported my own module begin to include all the
> > boilerplate.  I changed the original file to be:
> >
> > #lang at-exp "my-lang.rkt"
> >
> > But I get "bad language" path following at-exp.
> >
> > I suspect that at-exp doesn't work the same as s-exp for using module
> > languages?  If so, do I need to define a new #lang my-lang reader file
> ie,
> > my-lang/lang/reader.rkt?  Is there a shortcut to what I'm trying to do
> that
> > doesn't involve overriding read and read-syntax?
> >
> > Either that or I might just have a simple mistake in my-lang.rkt file.
> >
> > Thanks.
> >
> > --
> > Talk to you soon,
> >
> > Scott Klarenbach
> >
> > PointyHat Software Corp.
> > www.pointyhat.ca
> > p 604-568-4280
> > e scott at pointyhat.ca
> > 200-1575 W. Georgia
> > Vancouver, BC V6G2V3
> >
> > _______________________________________
> > To iterate is human; to recur, divine
> > ____________________
> >   Racket Users list:
> >   http://lists.racket-lang.org/users
>



-- 
Talk to you soon,

Scott Klarenbach

PointyHat Software Corp.
www.pointyhat.ca
p 604-568-4280
e scott at pointyhat.ca
200-1575 W. Georgia
Vancouver, BC V6G2V3

_______________________________________
To iterate is human; to recur, divine
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140112/1f5fed61/attachment.html>

Posted on the users mailing list.