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:
parent
3f70b2dc5c
commit
c6920dc8ba
4 changed files with 45 additions and 19 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue