mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-28 14:00:31 +02:00
Implemented the flet and flet* extensions.
* module/language/elisp/README: Document it. * module/language/elisp/compile-tree-il.scm: Implement flet and flet*. * test-suite/tests/elisp-compiler.test: Test flet and flet*.
This commit is contained in:
parent
3709984696
commit
e8f18b3f63
3 changed files with 77 additions and 38 deletions
|
@ -291,7 +291,23 @@
|
|||
(fset 'b 5)
|
||||
(and (fboundp 'b) (fboundp 'test)
|
||||
(not (fboundp 'a))
|
||||
(= a 1)))))
|
||||
(= a 1))))
|
||||
|
||||
(pass-if "flet and flet*"
|
||||
(progn (defun foobar () 42)
|
||||
(defun test () (foobar))
|
||||
(and (= (test) 42)
|
||||
(flet ((foobar (lambda () 0))
|
||||
(myfoo (symbol-function 'foobar)))
|
||||
(and (= (myfoo) 42)
|
||||
(= (test) 0)))
|
||||
(flet* ((foobar (lambda () 0))
|
||||
(myfoo (symbol-function 'foobar)))
|
||||
(= (myfoo) 0))
|
||||
(flet (foobar)
|
||||
(defun foobar () 0)
|
||||
(= (test) 0))
|
||||
(= (test) 42)))))
|
||||
|
||||
(with-test-prefix/compile "Calling Functions"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue