mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-01 04:10:18 +02:00
* module/system/il/compile.scm (codegen): Fix *another* bug in compiling `or' -- in the case in which the value was being discarded, as in `or' used as a control structure, we were sometimes leaving a value on the stack. * testsuite/t-or.scm: Add another test case for `or'.
29 lines
576 B
Scheme
29 lines
576 B
Scheme
;; all the different permutations of or
|
|
(list
|
|
;; not in tail position, no args
|
|
(or)
|
|
;; not in tail position, one arg
|
|
(or 'what)
|
|
(or #f)
|
|
;; not in tail position, two arg
|
|
(or 'what 'where)
|
|
(or #f 'where)
|
|
(or #f #f)
|
|
(or 'what #f)
|
|
;; not in tail position, value discarded
|
|
(begin (or 'what (error "two")) 'two)
|
|
;; in tail position (within the lambdas)
|
|
((lambda ()
|
|
(or)))
|
|
((lambda ()
|
|
(or 'what)))
|
|
((lambda ()
|
|
(or #f)))
|
|
((lambda ()
|
|
(or 'what 'where)))
|
|
((lambda ()
|
|
(or #f 'where)))
|
|
((lambda ()
|
|
(or #f #f)))
|
|
((lambda ()
|
|
(or 'what #f))))
|