[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Questions about floating numbers, rethink and bug report
From: |
Keith Wright |
Subject: |
Re: Questions about floating numbers, rethink and bug report |
Date: |
Wed, 10 Oct 2001 16:41:37 -0400 |
> 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)
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)
--
-- Keith Wright <address@hidden>
Programmer in Chief, Free Computer Shop <http://www.free-comp-shop.com>
--- Food, Shelter, Source code. ---
- Uniform vectors: was Questions about floating numbers, (continued)
- Re: Questions about floating numbers, rethink and bug report, Neil Jerram, 2001/10/14
- Re: Questions about floating numbers, rethink and bug report, Dirk Herrmann, 2001/10/15
- Re: Questions about floating numbers, rethink and bug report, Neil Jerram, 2001/10/16
- Re: Questions about floating numbers, rethink and bug report, Dirk Herrmann, 2001/10/16
- Re: Questions about floating numbers, rethink and bug report, Neil Jerram, 2001/10/20
- Re: Questions about floating numbers, rethink and bug report, Chris Cramer, 2001/10/10
- Re: Questions about floating numbers, rethink and bug report, Per Bothner, 2001/10/10
- Re: Questions about floating numbers, rethink and bug report,
Keith Wright <=
- Re: Questions about floating numbers, rethink and bug report, Dirk Herrmann, 2001/10/18
- Re: Questions about floating numbers, rethink and bug report, Chris Cramer, 2001/10/11
- Re: Questions about floating numbers, rethink and bug report, Keith Wright, 2001/10/11
- Re: Questions about floating numbers, rethink and bug report, Chris Cramer, 2001/10/11