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-lib/br/main.rkt

48 lines
2.1 KiB
Racket

9 years ago
#lang racket/base
(require racket/provide racket/list racket/string racket/format racket/match racket/port racket/function racket/provide
6 years ago
br/define br/syntax br/datum br/debug br/cond br/list br/reader-utils br/module racket/class racket/vector racket/promise
8 years ago
(for-syntax racket/base racket/syntax br/syntax br/debug br/define br/datum))
8 years ago
(provide (all-from-out racket/base)
8 years ago
(all-from-out racket/list racket/string racket/format racket/match racket/port racket/function racket/provide
6 years ago
br/syntax br/datum br/debug br/cond br/list br/reader-utils br/module racket/class racket/vector racket/promise br/define)
8 years ago
(for-syntax (all-from-out racket/base racket/syntax br/syntax br/debug br/datum))
8 years ago
(for-syntax caller-stx with-shared-id)) ; from br/define
8 years ago
8 years ago
(provide evaluate)
(define-macro (evaluate DATUM)
#'(begin
(define-namespace-anchor nsa)
(eval DATUM (namespace-anchor->namespace nsa))))
(provide really-dynamic-require)
(define-macro (really-dynamic-require . ARGS)
#'(parameterize ([current-namespace (make-base-namespace)])
(dynamic-require . ARGS)))
(module reader racket/base
(provide (rename-out
[br-read read]
[br-read-syntax read-syntax]
[brr-mod:get-info get-info]))
(module br-reader syntax/module-reader
#:language 'br
#:info br-get-info
5 years ago
#:read my-read
#:read-syntax my-read-syntax
(require br/get-info (prefix-in at: scribble/reader))
(define (my-read ip) (syntax->datum (my-read-syntax ip)))
(define (my-read-syntax src ip)
(parameterize ([current-readtable (at:make-at-readtable #:command-char #\◊)])
(read-syntax src ip))))
(require debug/reader (prefix-in brr-mod: 'br-reader))
#|
Use wrap-reader on the whole-module read function that would be exported
by the reader module, not the single-expression read function like
at:read-syntax that you deal with within syntax/module-reader or normal use.
|#
(define br-read (wrap-reader brr-mod:read))
(define br-read-syntax (wrap-reader brr-mod:read-syntax)))