diff options
author | Andy Wingo <wingo@pobox.com> | 2013-03-02 19:04:47 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2013-03-09 11:16:31 +0100 |
commit | 19113f1ca7a747de06d7b43c6c1eca4cd58d05e5 (patch) | |
tree | af7f198811ab1457763280792f10526db6ae4129 /module/language/tree-il/debug.scm | |
parent | 9ddf06dceee3a2bf5480a3e261ec01aaa91a1f67 (diff) | |
download | guile-19113f1ca7a747de06d7b43c6c1eca4cd58d05e5.tar.gz |
allow case-lambda expressions with no clauses
* module/ice-9/psyntax-pp.scm:
* module/ice-9/psyntax.scm (case-lambda, case-lambda*): Allow 0
clauses.
* module/language/scheme/decompile-tree-il.scm (do-decompile):
(choose-output-names):
* module/language/tree-il.scm (unparse-tree-il):
(tree-il-fold, post-order!, pre-order!):
* module/language/tree-il/effects.scm (make-effects-analyzer):
* module/language/tree-il/cse.scm (cse):
* module/language/tree-il/debug.scm (verify-tree-il):
* module/language/tree-il/peval.scm (peval): Allow for lambda-body to be
#f.
* libguile/memoize.c (memoize):
* module/language/tree-il/canonicalize.scm (canonicalize!): Give a body
to empty case-lambda before evaluating it or compiling it,
respectively.
* test-suite/tests/optargs.test ("case-lambda", "case-lambda*"): Add
tests.
Diffstat (limited to 'module/language/tree-il/debug.scm')
-rw-r--r-- | module/language/tree-il/debug.scm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/module/language/tree-il/debug.scm b/module/language/tree-il/debug.scm index 78f132416..97737c29b 100644 --- a/module/language/tree-il/debug.scm +++ b/module/language/tree-il/debug.scm @@ -1,6 +1,6 @@ ;;; Tree-IL verifier -;; Copyright (C) 2011 Free Software Foundation, Inc. +;; Copyright (C) 2011, 2013 Free Software Foundation, Inc. ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public @@ -115,10 +115,11 @@ (cond ((and meta (not (and (list? meta) (and-map pair? meta)))) (error "meta should be alist" meta)) - ((not (lambda-case? body)) + ((and body (not (lambda-case? body))) (error "lambda body should be lambda-case" exp)) (else - (visit body env)))) + (if body + (visit body env))))) (($ <let> src names gensyms vals body) (cond ((not (and (list? names) (and-map symbol? names))) |