#:use-module (srfi srfi-64)
#:use-module (srfi srfi-71)
#:use-module (vdc misc)
- #:replace
- (;(vdc:define . define)
- ;(vdc:primitive-eval . primitive-eval)
- )
#:export
(curried-untyped-define
equal-types?
(equal? lst (delete-duplicates lst))))
(define (sym-set! symtab name value)
- (assoc-set! symtab name value))
+ (let ((m (module-name (current-module))))
+ (assoc-set! symtab m
+ (assoc-set! (or (assoc-ref symtab m) '())
+ name value))))
(define (sym-set symtab sym value)
(sym-set! (alist-copy symtab) sym value))
-(define (sym-ref bindings name)
- (assoc-ref bindings name))
+(define (sym-ref symtab name)
+ (let ((m (module-name (current-module))))
+ (assoc-ref (or (assoc-ref symtab m) '()) name)))
(define (populate-tvs! node)
(map-tree!
(curried-untyped-define ((name var1) var2 ...) body ...))))
(define (∷% name type)
- (set! symtab (assoc-set! symtab name type)))
+ (set! symtab (sym-set! symtab name type)))
(define-syntax-rule (∷ name type)
(∷% 'name (parse 'type)))
(define (type-of x)
- (pt (assoc-ref symtab x)))
+ (pt (sym-ref symtab x)))