2012/5/11 Ray Racine <ray.rac...@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
____________________ Racket Users list: http://lists.racket-lang.org/users