1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 04:10:18 +02:00

lexical function binding for elisp

* module/language/elisp/compile-tree-il.scm (access-variable)
  (reference-variable, set-variable!): Handle globally-bound non-special
  variables.

  (bind-lexically?): Create lexical bindings for flet and flet*.

* module/language/elisp/runtime.scm (reference-variable, set-variable!):
  Handle globally-bound non-special variables.

  (built-in-func): Set the variable directly instead of storing the
  function in a fluid.

* module/language/elisp/runtime/subrs.scm (funcall): Call apply
  directly.

* test-suite/tests/elisp-compiler.test ("Function Definitions")["flet
  and flet*"]:

Signed-off-by: Andy Wingo <wingo@pobox.com>
This commit is contained in:
Brian Templeton 2010-08-16 03:20:55 -04:00 committed by Andy Wingo
parent 3f70b2dc5c
commit c6920dc8ba
4 changed files with 45 additions and 19 deletions

View file

@ -460,13 +460,13 @@
(flet ((foobar (lambda () 0))
(myfoo (symbol-function 'foobar)))
(and (= (myfoo) 42)
(= (test) 0)))
(= (test) 42)))
(flet* ((foobar (lambda () 0))
(myfoo (symbol-function 'foobar)))
(= (myfoo) 0))
(= (myfoo) 42))
(flet (foobar)
(defun foobar () 0)
(= (test) 0))
(= (test) 42))
(= (test) 42)))))
(with-test-prefix/compile "Calling Functions"