(module test mzscheme
(require (planet "infix.ss" ("dyoo" "infix.plt" 1 0)))
(infix printf("hello, this is a test: ~a ~a~n",
list(3, 4),
5))
(define (in-order a b c)
(infix printf("in-order(~a, ~a, ~a): ~a~n",
a, b, c, a <= b <= c))) (infix in-order(1, 2, 3)) (infix in-order(1, 3, 2)))
I had a very good laugh with Guillaume when I showed this to him. You have to be a Schemer to appreciate how very wrong this is.
This technique is a proof-of-concept that shows just how programmable the PLT Scheme syntax system can be. It wouldn't be much more work to embed a different programming language syntax in here, as long as it's compatible with s-expressions. The source code for this can be found here.
No comments:
Post a Comment