guile-user
[Top][All Lists]
Advanced

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

Re: Questions about floating numbers, rethink and bug report


From: Dirk Herrmann
Subject: Re: Questions about floating numbers, rethink and bug report
Date: Thu, 18 Oct 2001 20:46:17 +0200 (MEST)

On Wed, 10 Oct 2001, Keith Wright wrote:

> > From: Per Bothner <address@hidden>
> > 
> > There is no such thing as a "writable literal", since a literal refers
> > to the program text.  There are objects whose value is specified by a
> > literal, or (if you prefer) literals that are read as writable
> > objects.  However, writing to an object that was read from a literal
> > is like replacing the literal "5.0".  While some old Fortran compilers
> > would let you to that, no-one claimed that as a feature.  It is just
> > made for hard-to-catch bugs.
> 
> I think you are right, but Guile currently agrees with FORTRAN II
> on this point:
> 
> guile> (define lotus '#(1 2 3))
> guile> (define x lotus)
> guile> (vector-set! x 1 666)
> guile> lotus
> #(1 666 3)

We should probably have a test in the test suite that is marked as
expected to fail - this will be a way to remember the issue.  An entry in
BUGS or TODO might also make sense...

> Some implementations would give you a error message to prevent
> a seg-fault when you tried to change the program text.  If this
> upsets you think of this:
> 
> guile> (define (p)
>           (let ((lotus '#(1 2 3)))
>             (display lotus)(newline)
>             (vector-set! lotus 1 666)))
> guile> (p)
> #(1 2 3)
> guile> (p)
> #(1 666 3)

Same as above...

Best regards
Dirk Herrmann




reply via email to

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