Re: Scheme bug in internal define

From: Thomas Neumann <tom_at_smart.ruhr.de>
Date: 9 Nov 1997 00:06:30 -0000

Keith Wright writes:
> The following program exhibits a bug in both STk and Guile.
> (Somebody ought to try it on SCM.)
> One would expect it either to print "good" twice, or
> to display an error message. In fact it prints "good"
> and then "bad". MIT scheme prints "good" twice.
> I have STk-3.1 and guile-core-971005.
>
> (define (bug)
> (define good "good")
> (define bad "bad")
> (define (do-good) (display good)(newline))
> (do-good)
> (define ugly #f)
> (do-good))
> (bug)

I believe all (define ...) statements must appear first within
a block and may not be intermixed with other code. If you do,
the behaviour is undefined. I don't remember if this is defined
in R4RS somewhere; it's briefly mentioned in SICP.

-t
Received on Sun Nov 09 1997 - 01:04:05 CET

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST