all necessary changes to check references to uninitialized letrec variables

includes a new pass, letrec_check, two new primitives, and
changes to packages that grabbed the letrec undefined value

original commit: 72c958df628690ebc52a626d35cd4edcab0c7089
This commit is contained in:
Claire Alvis 2013-05-07 09:36:47 -04:00 committed by Matthew Flatt
parent 0fa48211d8
commit 8e300317ee
2 changed files with 5 additions and 5 deletions

View File

@ -8,6 +8,7 @@
racket/list
racket/match
racket/function
racket/undefined
unstable/function
(prefix-in c: (contract-req))
@ -91,8 +92,8 @@
(define/decl -Boolean (Un -False -True))
(define/decl -Undefined
(make-Base 'Undefined
#'(lambda (x) (equal? (letrec ([y y]) y) x)) ; initial value of letrec bindings
(lambda (x) (equal? (letrec ([y y]) y) x))))
#'undefined? ; initial value of letrec bindings
undefined?))
(define/decl -Bytes (make-Base 'Bytes #'bytes? bytes?))
(define/decl -Base-Regexp (make-Base 'Base-Regexp
#'(and/c regexp? (not/c pregexp?))

View File

@ -3,15 +3,14 @@
(require racket/match racket/contract/combinator
racket/fixnum racket/flonum
racket/set
racket/undefined
(only-in (combine-in racket/private/promise)
promise?
prop:force promise-forcer))
(define undef (letrec ([x x]) x))
(define (base-val? e)
(or (number? e) (string? e) (char? e) (symbol? e)
(null? e) (regexp? e) (eq? undef e) (path? e)
(null? e) (regexp? e) (undefined? e) (path? e)
(regexp? e) (keyword? e) (bytes? e) (boolean? e) (void? e)
;; Base values because you can only store flonums/fixnums in these
;; and not any higher-order values. This isn't sound if we ever