peval: bugfix in constant-expression?
authorAndy Wingo <wingo@pobox.com>
Thu, 6 Oct 2011 21:28:19 +0000 (23:28 +0200)
committerAndy Wingo <wingo@pobox.com>
Fri, 7 Oct 2011 09:06:56 +0000 (11:06 +0200)
* module/language/tree-il/peval.scm (constant-expression?): Correctly
  handle lambda-case alternates.

module/language/tree-il/peval.scm

index aadba24..4ceb793 100644 (file)
@@ -527,7 +527,8 @@ top-level bindings from ENV and return the resulting expression."
         (($ <const>) #t)
         (($ <lambda>) #t)
         (($ <lambda-case> _ req opt rest kw inits _ body alternate)
-         (and (every loop inits) (loop body) (loop alternate)))
+         (and (every loop inits) (loop body)
+              (or (not alternate) (loop alternate))))
         (($ <lexical-ref> _ _ gensym)
          (not (assigned-lexical? gensym)))
         (($ <primitive-ref>) #t)