fluid-ref / fluid-set! compile to dynref/dynset
authorAndy Wingo <wingo@pobox.com>
Fri, 19 Feb 2010 10:50:51 +0000 (11:50 +0100)
committerAndy Wingo <wingo@pobox.com>
Fri, 19 Feb 2010 11:10:12 +0000 (12:10 +0100)
* module/language/tree-il/primitives.scm: Resolve fluid-ref and
  fluid-set! as primitives, and thence to dynref/dynset.

module/language/tree-il/primitives.scm

index 48cb03c..4f83642 100644 (file)
@@ -61,6 +61,8 @@
     variable-bound?
     ;; args of variable-set are switched; it needs special help
 
+    fluid-ref fluid-set!
+
     struct? struct-vtable make-struct struct-ref struct-set!
 
     bytevector-u8-ref bytevector-u8-set!
                    expr
                    (make-lexical-ref #f 'post POST)))))))
 
+(hashq-set! *primitive-expand-table*
+            'fluid-ref
+            (case-lambda
+              ((src fluid) (make-dynref src fluid))
+              (else #f)))
+
+(hashq-set! *primitive-expand-table*
+            'fluid-set!
+            (case-lambda
+              ((src fluid exp) (make-dynset src fluid exp))
+              (else #f)))
+
 (hashq-set! *primitive-expand-table*
             'prompt
             (case-lambda