Merge branch 'stable-2.0'
[bpt/guile.git] / module / ice-9 / local-eval.scm
index f01a9c6..b81daf3 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*- mode: scheme; coding: utf-8; -*-
 ;;;
-;;; Copyright (C) 2012 Free Software Foundation, Inc.
+;;; Copyright (C) 2012, 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
                                  (cdr val)
                                  t)
                            patterns))))
+              ((ellipsis)
+               (lp ids capture formals
+                   (cons (lambda (x)
+                           #`(with-ellipsis #,val #,x))
+                         wrappers)
+                   patterns))
               (else
-               (error "what" type val))))))))))
+               ;; Interestingly, this case can include globals (and
+               ;; global macros), now that Guile tracks which globals it
+               ;; introduces.  Not sure what to do here!  For now, punt.
+               ;; 
+               (lp ids capture formals wrappers patterns))))))))))
 
 (define-syntax the-environment
   (lambda (x)
                         (scope (caddr l)))
                     (within-nested-ellipses (datum->syntax scope name) lvl)))
                 (lexenv-patterns e))))
-   ((module? e) `(lambda () #f ,exp))
+   ((module? e) #`(lambda () #f #,x))
    (else (error "invalid lexical environment" e))))
 
 (define (local-eval x e)