unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: David Kastrup <dak@gnu.org>
To: 13843@debbugs.gnu.org
Cc: David Kastrup <dak@gnu.org>
Subject: bug#13843: [PATCH] Fix "later bindings win" stipulation for with-fluids
Date: Thu, 28 Feb 2013 11:04:06 +0100	[thread overview]
Message-ID: <1362045846-8591-1-git-send-email-dak@gnu.org> (raw)

The following code displayed 2:

(define a (make-fluid))
(with-fluids ((a 1) (a 2) (a 3))
	     (display (fluid-ref a)))
---
 libguile/fluids.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libguile/fluids.c b/libguile/fluids.c
index bd59e26..11309c9 100644
--- a/libguile/fluids.c
+++ b/libguile/fluids.c
@@ -321,7 +321,7 @@ scm_i_make_with_fluids (size_t n, SCM *fluids, SCM *vals)
     size_t i, j = n;
 
     while (j--)
-      for (i = 0; i < j; i++)
+      for (i = j; i--;)
         if (scm_is_eq (fluids[i], fluids[j]))
           {
             vals[i] = vals[j]; /* later bindings win */
-- 
1.7.10.4






             reply	other threads:[~2013-02-28 10:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-28 10:04 David Kastrup [this message]
2013-02-28 23:48 ` bug#13843: [PATCH] Fix "later bindings win" stipulation for with-fluids Mark H Weaver

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1362045846-8591-1-git-send-email-dak@gnu.org \
    --to=dak@gnu.org \
    --cc=13843@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).