Very strange bug on Streams and probably compiler
Damien Cassou
damien.cassou at laposte.net
Wed Feb 14 16:19:13 UTC 2007
On Feb 14, 2007, at 4:36 PM, Bert Freudenberg wrote:
> It is normal.
This is normal for you because you know how the compiler works. But
do you think the compiler works normally? Is it normal that a
compiler considers two equal strings as identical? I would agree with
symbols because symbols are immutable. I think this is a first bug, a
bug in the compiler.
In my opinion, there is another bug. When the collection of a stream
becomes full, its is replaced by another bigger collection. So,
first, the stream uses the collection you passed to the constructor,
then, at a given time, this collection is replaced by a new one. I
don't think it's a normal behavior. In my opinion, the collection
must always be the one you gave at the beginning OR it must always be
a copy. I prefer the second solution.
So, what should be done ? I can write tests for the compiler and
tests for streams to show the behavior. This tests will fail because
they show a non corrected bug.
> Lesson: never modify string literals.
Lesson: Use a correct compiler :-)
--
Damien Cassou
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20070214/390347f6/attachment.htm
More information about the Squeak-dev
mailing list
|