mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-30 08:50:23 +02:00
(while): Remove the unquote from do, it breaks with ice-9
syncase. Reported by Pach Roman.
This commit is contained in:
parent
76da80e788
commit
c8fc38b13b
1 changed files with 12 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
;;; installed-scm-file
|
;;; installed-scm-file
|
||||||
|
|
||||||
;;;; Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
|
;;;; Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005
|
||||||
;;;; Free Software Foundation, Inc.
|
;;;; Free Software Foundation, Inc.
|
||||||
;;;;
|
;;;;
|
||||||
;;;; This library is free software; you can redistribute it and/or
|
;;;; This library is free software; you can redistribute it and/or
|
||||||
|
@ -2754,6 +2754,16 @@
|
||||||
;; `while' even when recursing. `while-helper' is an easy way to keep the
|
;; `while' even when recursing. `while-helper' is an easy way to keep the
|
||||||
;; `key' binding away from the cond and body code.
|
;; `key' binding away from the cond and body code.
|
||||||
;;
|
;;
|
||||||
|
;; FIXME: This is supposed to have an `unquote' on the `do' the same used
|
||||||
|
;; for lambda and not, so as to protect against any user rebinding of that
|
||||||
|
;; symbol, but unfortunately an unquote breaks with ice-9 syncase, eg.
|
||||||
|
;;
|
||||||
|
;; (use-modules (ice-9 syncase))
|
||||||
|
;; (while #f)
|
||||||
|
;; => ERROR: invalid syntax ()
|
||||||
|
;;
|
||||||
|
;; This is probably a bug in syncase.
|
||||||
|
;;
|
||||||
(define-macro (while cond . body)
|
(define-macro (while cond . body)
|
||||||
(define (while-helper proc)
|
(define (while-helper proc)
|
||||||
(do ((key (make-symbol "while-key")))
|
(do ((key (make-symbol "while-key")))
|
||||||
|
@ -2763,7 +2773,7 @@
|
||||||
(lambda () (throw key #f))))
|
(lambda () (throw key #f))))
|
||||||
(lambda (key arg) arg)))))
|
(lambda (key arg) arg)))))
|
||||||
`(,while-helper (,lambda (break continue)
|
`(,while-helper (,lambda (break continue)
|
||||||
(,do ()
|
(do ()
|
||||||
((,not ,cond))
|
((,not ,cond))
|
||||||
,@body)
|
,@body)
|
||||||
#t)))
|
#t)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue