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.
13 lines
436 B
Racket
13 lines
436 B
Racket
6 years ago
|
#lang br
|
||
|
(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 racket
|
||
|
EXPR ...)))))
|