Use current-readtable as the base for the TR readtable.

Closes PR 1115.

original commit: 72f31ffec02fc4c8f39169b80811bca98abb8f75
This commit is contained in:
Sam Tobin-Hochstadt 2010-08-21 12:20:23 -04:00
commit 5df8b46738
6 changed files with 29 additions and 8 deletions

View File

@ -0,0 +1,9 @@
#lang at-exp typed/racket
(define contents
(lambda args args))
(define doc @contents{x y})
@contents{x y}

View File

@ -0,0 +1,3 @@
#lang typed-scheme/no-check
(: foo : Void -> Void)
(define (foo x) x)

View File

@ -20,8 +20,16 @@
;; eq? has the type of equal?, and l is an alist (with conses!)
;; props is a list of known propositions
(r:d-s/c env ([l (and/c (not/c dict-mutable?) dict?)]) #:transparent)
(r:d-s/c (prop-env env) ([props (listof Filter/c)]) #:transparent)
(r:d-s/c env ([l (and/c (not/c dict-mutable?) dict?)])
#:transparent
#:property prop:custom-write
(lambda (e prt mode)
(fprintf prt "(env ~a)" (dict-map (env-l e) list))))
(r:d-s/c (prop-env env) ([props (listof Filter/c)])
#:transparent
#:property prop:custom-write
(lambda (e prt mode)
(fprintf prt "(env ~a ~a)" (dict-map (env-l e) list) (prop-env-props e))))
(define (mk-env orig dict)
(match orig

View File

@ -14,5 +14,5 @@
(require (for-syntax typed-scheme/utils/tc-utils scheme/base))
(begin-for-syntax (set-box! typed-context? #t)))
(current-namespace))
(current-readtable readtable))
(current-readtable (readtable)))

View File

@ -3,10 +3,11 @@
(require
(except-in "private/prims.rkt"
require/typed require/opaque-type require-typed-struct)
"private/base-types-extra.rkt"
(for-syntax scheme/base syntax/parse syntax/struct))
(provide (all-from-out scheme/base)
(all-defined-out)
(all-from-out "private/prims.rkt"))
(all-from-out "private/prims.rkt" "private/base-types-extra.rkt"))
(define-syntax (require/typed stx)

View File

@ -72,15 +72,15 @@
(let-values ([(l c p) (port-next-location port)])
(list src line col pos (and pos (- p pos)))))]))
(define readtable
(make-readtable #f #\{ 'dispatch-macro parse-id-type))
(define (readtable)
(make-readtable (current-readtable) #\{ 'dispatch-macro parse-id-type))
(define (*read inp)
(parameterize ([current-readtable readtable])
(parameterize ([current-readtable (readtable)])
(read inp)))
(define (*read-syntax src port)
(parameterize ([current-readtable readtable])
(parameterize ([current-readtable (readtable)])
(read-syntax src port)))
(provide readtable (rename-out [*read read] [*read-syntax read-syntax]))