[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange undefined binding bug coupled to module system

From: Mikael Djurfeldt
Subject: Re: Strange undefined binding bug coupled to module system
Date: 10 Nov 2004 09:51:21 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Marius Vollmer <address@hidden> writes:

> Mikael Djurfeldt <address@hidden> writes:
> > 2004-04-22  Dirk Herrmann  <address@hidden>
> >
> >     (scm_m_define): Change order to first create binding and
> >     evaluating the expression afterwards.
> >
> > While this change works in the R5RS situation without a module system,
> > the presence of a module system, with the difference between imported
> > and local bindings, introduces complications.
> What would happen if you just revert that change?

The change is a bugfix for another bug, so reverting it would swap one
bug for another.

The bug which Dirk fixed is that Guile previously created the binding
after the expression of the define had been evaluated, while R5RS
section 5.2.1 specifies that a define is like a set! to an existing
binding.  Thus, R5RS allows an expression like:

  (define foo (begin (set! foo 3) (* 5 foo)))

Chez Scheme accepts the above expression and Guile does it after
Dirk's change.  If we reverted the change, Guile would complain that
foo is an unbound variable, which is inconsistent with R5RS.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]