;(vdc:primitive-eval . primitive-eval)
)
#:export
- (equal-types?
+ (curried-untyped-define
+ equal-types?
expand
parse
symtab
(and (every symbol? lst)
(equal? lst (delete-duplicates lst))))
-(define (sym-set! bindings name value)
- (let ((symtab bindings))
- (assoc-set! symtab name value)))
+(define (sym-set! symtab name value)
+ (assoc-set! symtab name value))
+
+(define (sym-set symtab sym value)
+ (sym-set! (alist-copy symtab) sym value))
(define (sym-ref bindings name)
(assoc-ref bindings name))
x))
node))
-(define (sym-set symtab sym value)
- (sym-set! (alist-copy symtab) sym value))
-
(define (expand symtab expr)
(match expr
(('quote x)
(let ((t e (expand symtab body)))
(if (not t)
(type-error 5 "in body of" `(definec ,name ,body))
- (begin
- (∷% name t)
- (values
- #f
- `(define ,name ,e))))))
+ (values
+ #f
+ `(begin
+ ((@@ (vdc curry) ∷%)
+ ',name
+ ((@ (vdc curry) parse)
+ ',(bare-type t)))
+ (define ,name ,e))))))
((f)
(let ((t e (expand symtab f)))
(values