You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
beautiful-racket/beautiful-racket-demo/conjunction-demo/main.rkt

27 lines
746 B
Racket

#lang br/quicklang
(module reader br
(provide read-syntax)
(define (read-syntax name port)
(define s-exprs (let loop ([toks null])
(define tok (read port))
(if (eof-object? tok)
(reverse toks)
(loop (cons tok toks)))))
(strip-bindings
(with-syntax ([(EXPR ...) s-exprs])
#'(module read-only-mod conjunction-demo
EXPR ...)))))
(define (convert-expr x)
6 years ago
(cond
[(list? x) (map convert-expr x)]
[(number? x) 42]
[(string? x) "whee"]
[else 'kaboom]))
5 years ago
(define-macro (my-module-begin EXPR ...)
#'(#%module-begin
(convert-expr 'EXPR) ...))
5 years ago
(provide (rename-out [my-module-begin #%module-begin]))