[racket] `def' ?

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Sat May 12 12:55:28 EDT 2012

2012/5/11 Ray Racine <ray.racine at gmail.com>

> Give '{' yada '}' definable language semantics in the sense of #lang yada.
>
> Similar to SML-NJ Quote/Antiquote but leveraging Rackets more robust
> built-in language support.
>
> So a source file could be.
>
> ==========
> #lang racket
> #lang {{ formula }}
>
> (define x 3)
> (define y 2)
>
> (define z {{ log (x + y) }})
>
> #lang {{ datalog }} ;; switch datalog language
>
> (define result {{
>   ancestor(A, B) :- parent(A, B).   ancestor(A, B) :-   parent(A, C), D =
> C, ancestor(D, B).   parent(john, douglas).   parent(bob, john).
> ancestor(A, B)?
> }} )
>
> #lang {{ formula }} ;; back to math formula
>
> (define ans (some-procedure result {{ z^2 + 42 }}))
> =======
>
> just works.
>
>
Ooh. Nice idea.

-- 
Jens Axel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120512/78148ee8/attachment-0001.html>

Posted on the users mailing list.