Add no-check language
This commit is contained in:
parent
5ac64589ba
commit
c7b51cfd2d
5
collects/typed-scheme/no-check.ss
Normal file
5
collects/typed-scheme/no-check.ss
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
#lang scheme/base
|
||||||
|
|
||||||
|
(require "private/prims.ss")
|
||||||
|
(provide (all-from-out scheme/base)
|
||||||
|
(all-from-out "private/prims.ss"))
|
13
collects/typed-scheme/no-check/lang/reader.ss
Normal file
13
collects/typed-scheme/no-check/lang/reader.ss
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
#lang scheme/base
|
||||||
|
(require (prefix-in r: "../../typed-reader.ss")
|
||||||
|
(only-in syntax/module-reader wrap-read-all))
|
||||||
|
|
||||||
|
(define (*read in modpath line col pos)
|
||||||
|
(wrap-read-all 'typed-scheme/no-check in r:read modpath #f line col pos))
|
||||||
|
|
||||||
|
(define (*read-syntax src in modpath line col pos)
|
||||||
|
(wrap-read-all
|
||||||
|
'typed-scheme/no-check in (lambda (in) (r:read-syntax src in))
|
||||||
|
modpath src line col pos))
|
||||||
|
|
||||||
|
(provide (rename-out [*read read] [*read-syntax read-syntax]))
|
|
@ -95,7 +95,8 @@
|
||||||
;; typecheck an expression, but throw away the effect
|
;; typecheck an expression, but throw away the effect
|
||||||
;; tc-expr/t : Expr -> Type
|
;; tc-expr/t : Expr -> Type
|
||||||
(define (tc-expr/t e) (match (tc-expr e)
|
(define (tc-expr/t e) (match (tc-expr e)
|
||||||
[(tc-result: t) t]))
|
[(tc-result: t) t]
|
||||||
|
[t (int-err "tc-expr returned ~a, not a tc-result, for ~a" t (syntax->datum e))]))
|
||||||
|
|
||||||
(define (tc-expr/check/t e t)
|
(define (tc-expr/check/t e t)
|
||||||
(match (tc-expr/check e t)
|
(match (tc-expr/check e t)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user