Why does 'four' readStream next: 5
not throw an exception like it does in VW?
Is this a buglet?
Daniel Klein
Not a bug.
"The result is undefined if amount is larger than the number of objects in the receiver's future sequence values." (ANSI 5.9.2.4)
James Foster
On Jan 24, 2009, at 7:23 PM, Daniel Klein wrote:
Why does
'four' readStream next: 5
not throw an exception like it does in VW?
Is this a buglet?
Daniel Klein
This is a bug however:
'four' readStream isEmpty --> true
"Returns true if both the set of past and future sequence values of the receiver are empty. Otherwise returns false." (ANSI 5.9.1.3)
On Sun, Jan 25, 2009 at 4:30 AM, James Foster Smalltalk@jgfoster.net wrote:
Not a bug. "The result is undefined if amount is larger than the number of objects in the receiver's future sequence values." (ANSI 5.9.2.4) James Foster On Jan 24, 2009, at 7:23 PM, Daniel Klein wrote:
Why does 'four' readStream next: 5 not throw an exception like it does in VW? Is this a buglet? Daniel Klein
On Sun, Jan 25, 2009 at 9:59 AM, Lukas Renggli renggli@gmail.com wrote:
This is a bug however:
'four' readStream isEmpty --> true
"Returns true if both the set of past and future sequence values of the receiver are empty. Otherwise returns false." (ANSI 5.9.1.3)
The Squeak stream implementation is buggy and ugly. Nile is better and does not have this particular bug :-).
The amount, 5, IS larger than the number of objects, 4. So the result should be 'undefined', yet it returns the receiver, 'four'. And I don't believe the string 'four' has any 'future' of getting larger. I'm somewhat new to all this.
Daniel Klein
On Sat, Jan 24, 2009 at 10:30 PM, James Foster Smalltalk@jgfoster.netwrote:
Not a bug. "The result is undefined if amount is larger than the number of objects in the receiver's future sequence values." (ANSI 5.9.2.4) James Foster
On Jan 24, 2009, at 7:23 PM, Daniel Klein wrote:
Why does 'four' readStream next: 5
not throw an exception like it does in VW?
Is this a buglet?
Daniel Klein
On Sun, Jan 25, 2009 at 2:29 PM, Daniel Klein danielkleinad@gmail.com wrote:
The amount, 5, IS larger than the number of objects, 4. So the result should be 'undefined', yet it returns the receiver, 'four'. And I don't believe the string 'four' has any 'future' of getting larger.
In a standard (like the one James Foster quotes from), 'undefined' means 'the value depends on the particular implementation you are using, is not standardized, and can be anything ; you should not rely on this'.
squeak-dev@lists.squeakfoundation.org