summaryrefslogtreecommitdiff
path: root/module/language
diff options
context:
space:
mode:
authorBT Templeton <bpt@hcoop.net>2011-07-30 17:12:13 -0400
committerBT Templeton <bpt@hcoop.net>2012-02-03 18:53:49 -0500
commit35724ee1dc5b48aa80b437950444cbe40c8e350e (patch)
tree36236ac3477b49ca50da24a5e25142c58667f65d /module/language
parent0ab2a63af1a7ff4febfe97babb3053fbf483b704 (diff)
downloadguile-35724ee1dc5b48aa80b437950444cbe40c8e350e.tar.gz
remove dynamic function binding
* module/language/elisp/compile-tree-il.scm (find-operator): Assume that `name' is lexically bound. * module/language/elisp/runtime.scm (symbol-fbound?, fmakunbound!): Assume that `symbol' is lexically bound. (defspecial): Bind special operators lexically.
Diffstat (limited to 'module/language')
-rw-r--r--module/language/elisp/compile-tree-il.scm9
-rw-r--r--module/language/elisp/runtime.scm25
2 files changed, 12 insertions, 22 deletions
diff --git a/module/language/elisp/compile-tree-il.scm b/module/language/elisp/compile-tree-il.scm
index 9cec195f5..d61311d39 100644
--- a/module/language/elisp/compile-tree-il.scm
+++ b/module/language/elisp/compile-tree-il.scm
@@ -529,12 +529,11 @@
;;; Handle macro and special operator bindings.
-(define (find-operator sym type)
+(define (find-operator name type)
(and
- (symbol? sym)
- (module-defined? (resolve-interface function-slot) sym)
- (let* ((op (module-ref (resolve-module function-slot) sym))
- (op (if (fluid? op) (fluid-ref op) op)))
+ (symbol? name)
+ (module-defined? (resolve-interface function-slot) name)
+ (let ((op (module-ref (resolve-module function-slot) name)))
(if (and (pair? op) (eq? (car op) type))
(cdr op)
#f))))
diff --git a/module/language/elisp/runtime.scm b/module/language/elisp/runtime.scm
index d66007b1e..b0aaded1b 100644
--- a/module/language/elisp/runtime.scm
+++ b/module/language/elisp/runtime.scm
@@ -108,12 +108,9 @@
(define (symbol-fbound? symbol)
(and
(module-bound? (resolve-interface function-slot-module) symbol)
- (let* ((var (module-variable (resolve-module function-slot-module)
- symbol)))
- (and (variable-bound? var)
- (if (fluid? (variable-ref var))
- (fluid-bound? (variable-ref var))
- #t)))))
+ (variable-bound?
+ (module-variable (resolve-module function-slot-module)
+ symbol))))
(define (makunbound! symbol)
(if (module-bound? (resolve-interface value-slot-module) symbol)
@@ -126,12 +123,9 @@
(define (fmakunbound! symbol)
(if (module-bound? (resolve-interface function-slot-module) symbol)
- (let ((var (module-variable
- (resolve-module function-slot-module)
- symbol)))
- (if (and (variable-bound? var) (fluid? (variable-ref var)))
- (fluid-unset! (variable-ref var))
- (variable-unset! var))))
+ (variable-unset! (module-variable
+ (resolve-module function-slot-module)
+ symbol)))
symbol)
;;; Define a predefined macro for use in the function-slot module.
@@ -155,8 +149,5 @@
(syntax-case x ()
((_ name args body ...)
(with-syntax ((scheme-name (make-id #'name 'compile- #'name)))
- #'(begin
- (define scheme-name (make-fluid))
- (fluid-set! scheme-name
- (cons 'special-operator
- (lambda args body ...)))))))))
+ #'(define scheme-name
+ (cons 'special-operator (lambda args body ...))))))))