[plt-scheme] #lang and planet
It does. Look at the documentation for the PLAI and Javascript languages:
http://planet.plt-scheme.org/package-source/plai/plai.plt/1/1/planet-docs/plai/index.html
http://planet.plt-scheme.org/package-source/dherman/javascript.plt/9/1/planet-docs/javascript/index.html
On Fri, Apr 24, 2009 at 3:32 PM, Jens Axel Soegaard
<jensaxel at soegaard.net> wrote:
> I am working on a reader extension that allows
> one to use "standard" mathematical syntax.
> It was straightforward to create a readtable
> called math-readtable hijacking $, that allowed
> me write the following in the REPL:
>
> > (current-readtable math-readtable)
> > $"1+2*3"
> 7
>
> The next step was make a new language that
> extends the normal Scheme syntax with
> the $"..." syntax.
>
> For that I used syntax/module-reader.
> Now I can prefix my programs with
>
> #lang math-lang
>
> and everything works okay.
>
> But... I can't figure out how to my language
> into a PLaneT package.
>
> Does the #lang syntax support languages from
> Planet?
>
>
>
>
> For the curious, a few examples:
>
>
> #lang math-lang
>
> $"1+2*3"
>
> (let ([x 1])
> $"x+2")
>
> $"list[1,2,3]"
>
> $"{1,2,3}"
>
> (define (f x) (* 2 x))
> $"map[f,{1,2,3}]"
>
> $"map[(?x.2*x), {1,2,3}]"
>
>
> The output is:
>
> 7
> 3
> (1 2 3)
> (1 2 3)
> (2 4 6)
> (2 4 6)
>
>
> --
> Jens Axel Søgaard
> _________________________________________________
> 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