[plt-scheme] #lang and planet
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