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/quantum-taco-demo/main.rkt

20 lines
390 B
Racket

#lang br/quicklang
(module+ reader
(provide read-syntax))
(define (tokenize ip)
(for/list ([tok (in-port read ip)])
6 years ago
tok))
(define (parse tok)
(if (list? tok)
(map parse tok)
'taco))
(define (read-syntax src ip)
(define toks (tokenize ip))
(define parse-tree (parse toks))
(with-syntax ([(PT ...) parse-tree])
#'(module tacofied racket
'PT ...)))