[squeak-dev] readStream question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] readStream question

Daniel Klein-3
Why does

'four' readStream next: 5

not throw an exception like it does in VW?

Is this a buglet?

Daniel Klein


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] readStream question

jgfoster
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




Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] readStream question

Lukas Renggli
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 <[hidden email]> 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
>
>
>
>
>



--
Lukas Renggli
http://www.lukas-renggli.ch

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] readStream question

Damien Cassou-3
On Sun, Jan 25, 2009 at 9:59 AM, Lukas Renggli <[hidden email]> 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 :-).

--
Damien Cassou
http://damiencassou.seasidehosting.st

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] readStream question

Daniel Klein-3
In reply to this post by jgfoster
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 <[hidden email]> 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








Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] readStream question

Damien Cassou-3
On Sun, Jan 25, 2009 at 2:29 PM, Daniel Klein <[hidden email]> 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'.



--
Damien Cassou
http://damiencassou.seasidehosting.st