Thanks
On Thu, Apr 12, 2018 at 5:06 PM, Alistair Grant wrote:
> On 11 April 2018 at 20:47, Sven Van Caekenberghe wrote:
>>
>> But there is something wrong with what is returned by Stdio stdin
>>
>
> I've opened
>
On 11 April 2018 at 20:47, Sven Van Caekenberghe wrote:
>
> But there is something wrong with what is returned by Stdio stdin
>
I've opened
https://pharo.fogbugz.com/f/cases/21692/StdioStream-incorrectly-delegates-atEnd-and-position-to-file
PR in progress.
Cheers,
Alistair
On 12 April 2018 at 10:48, Alistair Grant wrote:
>
> So I'm going to respectfully disagree and say that I think to raise a
> MNU instead of returning nil is wrong, and that changing the Zinc
> streams isn't such a big deal.
Sorry Sven, this sounds like I'm suggesting that
Hi Sven,
On Thu, Apr 12, 2018 at 09:23:21AM +0200, Sven Van Caekenberghe wrote:
>
>
> > On 12 Apr 2018, at 08:33, Alistair Grant wrote:
> >
> > ...
> >
> > In your example you've carefully exited by some other means than
> > signalling end-of-file (Ctrl-D).
> >
> > I don't
> On 12 Apr 2018, at 03:15, Eliot Miranda wrote:
>
> Hi Sven,
>
> On Wed, Apr 11, 2018 at 1:25 PM, Sven Van Caekenberghe wrote:
>
>
> > On 11 Apr 2018, at 21:44, Stephane Ducasse wrote:
> >
> > I did not know about the
> On 12 Apr 2018, at 04:07, Ben Coman wrote:
>
>
>
> On 12 April 2018 at 04:25, Sven Van Caekenberghe wrote:
>
>
> > On 11 Apr 2018, at 21:44, Stephane Ducasse wrote:
> >
> > I did not know about the NeoConsole. Nice because I
> On 12 Apr 2018, at 08:33, Alistair Grant wrote:
>
> Hi Sven,
>
> On 11 April 2018 at 20:47, Sven Van Caekenberghe wrote:
>> Alistair,
>>
>>> On 11 Apr 2018, at 19:42, Sven Van Caekenberghe wrote:
>>>
>>> I will send you some code later
Hi Sven,
On 11 April 2018 at 20:47, Sven Van Caekenberghe wrote:
> Alistair,
>
>> On 11 Apr 2018, at 19:42, Sven Van Caekenberghe wrote:
>>
>> I will send you some code later on.
>
> Today I arranged for my NeoConsole code (that normally works over a network
>
On Wednesday 11 April 2018 10:38 PM, Alistair Grant wrote:
StandardFileStream>>readInto:startingAt:count: assumes that
primitiveFileRead will always attempt to read count bytes, but it
actually only attempts to read 1.
StandardFileStream>>#basicNext uses
position < readLimit ifFalse:
and
On 11 April 2018 at 19:42, Nicolas Cellier
wrote:
>
>
> 2018-04-11 19:08 GMT+02:00 Alistair Grant :
>>
>> Hi Sven,
>>
>> On 11 April 2018 at 18:53, Sven Van Caekenberghe wrote:
>> > Something is off (and/or I am getting
On 12 April 2018 at 04:25, Sven Van Caekenberghe wrote:
>
>
> > On 11 Apr 2018, at 21:44, Stephane Ducasse
> wrote:
> >
> > I did not know about the NeoConsole. Nice because I wanted to build a
> > little REPL for my minilanguage implementation.
>
> You
Hi Sven,
On Wed, Apr 11, 2018 at 1:25 PM, Sven Van Caekenberghe wrote:
>
>
> > On 11 Apr 2018, at 21:44, Stephane Ducasse
> wrote:
> >
> > I did not know about the NeoConsole. Nice because I wanted to build a
> > little REPL for my minilanguage
> On 11 Apr 2018, at 21:44, Stephane Ducasse wrote:
>
> I did not know about the NeoConsole. Nice because I wanted to build a
> little REPL for my minilanguage implementation.
You are of course welcome to look at it.
But it is Pharo specific.
I use it to be able to
I did not know about the NeoConsole. Nice because I wanted to build a
little REPL for my minilanguage implementation.
Stef
On Wed, Apr 11, 2018 at 8:47 PM, Sven Van Caekenberghe wrote:
> Alistair,
>
>> On 11 Apr 2018, at 19:42, Sven Van Caekenberghe wrote:
>>
>> I
On Wed, Apr 11, 2018 at 5:33 PM, Sven Van Caekenberghe wrote:
> I think we have to reset this whole discussion.
>
> FileStream stdin
>
> and
>
> Stdio stdin
>
> are completely different !
Could you explain the difference because I'm dead tired and got confused :)
>
> We'll
On Wed, Apr 11, 2018 at 12:04 PM, Denis Kudriashov wrote:
> Hi Alistair.
>
> I don't think anybody is annoyed by you. You are doing really good job. And
> nice thing that you are super patient to continue :)
+10
>
> What I try to understand is why blocking atEnd is
Alistair,
> On 11 Apr 2018, at 19:42, Sven Van Caekenberghe wrote:
>
> I will send you some code later on.
Today I arranged for my NeoConsole code (that normally works over a network
connection) to work over stdio. Although I am not yet happy with every aspect
of the
2018-04-11 19:08 GMT+02:00 Alistair Grant :
> Hi Sven,
>
> On 11 April 2018 at 18:53, Sven Van Caekenberghe wrote:
> > Something is off (and/or I am getting crazy, probably both).
> >
> > $ ./pharo --headless Pharo.image eval '(FileStream stdin binary; next:
Hmm, but why does the following work then ?
$ ./pharo --headless Pharo.image eval '(FileStream stdin next: 3)'
123
'123'
The binary case is an error though, for sure.
And Zn character decoding works on binary streams, while the buffering streams
read in blocks.
And it always comes back to
Hi Sven,
On 11 April 2018 at 18:53, Sven Van Caekenberghe wrote:
> Something is off (and/or I am getting crazy, probably both).
>
> $ ./pharo --headless Pharo.image eval '(FileStream stdin binary; next: 3)'
> 123
> #[49]
>
> ??
>
> This should return #[49 50 51] AFAIK.
I haven't
Something is off (and/or I am getting crazy, probably both).
$ ./pharo --headless Pharo.image eval '(FileStream stdin binary; next: 3)'
123
#[49]
??
This should return #[49 50 51] AFAIK.
> On 11 Apr 2018, at 18:26, Alistair Grant wrote:
>
> Hi Sven,
>
> On 11 April
Hi Sven,
On 11 April 2018 at 17:33, Sven Van Caekenberghe wrote:
> I think we have to reset this whole discussion.
>
> FileStream stdin
>
> and
>
> Stdio stdin
>
> are completely different !
>
> We'll have to check that first, before talking about the issues raised in
> this
Hi Denis,
On 11 April 2018 at 17:16, Denis Kudriashov wrote:
>
> 2018-04-11 17:02 GMT+02:00 Sven Van Caekenberghe :
>>
>>
>>
>> > On 11 Apr 2018, at 16:36, Sven Van Caekenberghe wrote:
>> >
>> > I can make your example, using the Zn variants,
I think we have to reset this whole discussion.
FileStream stdin
and
Stdio stdin
are completely different !
We'll have to check that first, before talking about the issues raised in this
thread.
And BTW these terminal streams are a real pain to test ;-)
> On 11 Apr 2018, at 17:20,
> On 11 Apr 2018, at 17:16, Denis Kudriashov wrote:
>
>
> 2018-04-11 17:02 GMT+02:00 Sven Van Caekenberghe :
>
>
> > On 11 Apr 2018, at 16:36, Sven Van Caekenberghe wrote:
> >
> > I can make your example, using the Zn variants, work with
2018-04-11 17:02 GMT+02:00 Sven Van Caekenberghe :
>
>
> > On 11 Apr 2018, at 16:36, Sven Van Caekenberghe wrote:
> >
> > I can make your example, using the Zn variants, work with the following
> change:
> >
> > StdioStream>>#atEnd
> > ^ peekBuffer isNil or: [
> On 11 Apr 2018, at 16:36, Sven Van Caekenberghe wrote:
>
> I can make your example, using the Zn variants, work with the following
> change:
>
> StdioStream>>#atEnd
> ^ peekBuffer isNil or: [ (peekBuffer := self next) isNil ]
Argh, make that
atEnd
^ peekBuffer isNil and:
I can make your example, using the Zn variants, work with the following change:
StdioStream>>#atEnd
^ peekBuffer isNil or: [ (peekBuffer := self next) isNil ]
Which is a literal implementation of your statement that you can only know that
you are atEnd by reading (and thus waiting/blocking)
On 11 April 2018 at 15:11, Sven Van Caekenberghe wrote:
>
>
>> On 11 Apr 2018, at 11:12, Sven Van Caekenberghe wrote:
>>
>> How does one modify #atEnd to block ? I suppose you are talking about
>> StdioStream>>#atEnd ?
>>
>> ^ self peek isNil
>>
>> ?
>
> Still the
OS pipes are a similar case. On Pharo, you can run CommandShellTestCase to
provide some test coverage for this.
Dave
On Wed, Apr 11, 2018 at 03:13:35PM +0200, Denis Kudriashov wrote:
> Thanks for explanation.
>
> I think it would be same scenario for socket stream where #atEnd is not
>
Hi Alistair,
I must take my part too: I suggested that we could use a pair of
getc/ungetc to know if we are atEnd(OfData), but this obviously works well
with AsyncFileIO only, else it blocks.
For files, this generally isn't a problem (but maybe for network mounted
partitions), the latency is
Thanks for explanation.
I think it would be same scenario for socket stream where #atEnd is not
blocking. So I agree that it is expected behaviour.
The example is general enough to expect it to be working for any given pair
of in and out streams. So our streams should support this.
2018-04-11
> On 11 Apr 2018, at 11:12, Sven Van Caekenberghe wrote:
>
> How does one modify #atEnd to block ? I suppose you are talking about
> StdioStream>>#atEnd ?
>
> ^ self peek isNil
>
> ?
Still the same question, how do you implement a blocking #atEnd for stdin ?
I have seen your
Hi Sven & Dennis,
On 11 April 2018 at 12:04, Denis Kudriashov wrote:
> Hi Alistair.
>
> I don't think anybody is annoyed by you. You are doing really good job. And
> nice thing that you are super patient to continue :)
>
On 11 April 2018 at 12:13, Sven Van Caekenberghe
> On 11 Apr 2018, at 12:04, Denis Kudriashov wrote:
>
> I don't think anybody is annoyed by you. You are doing really good job. And
> nice thing that you are super patient to continue :)
Yes, Alistair, you are a top notch open source contributor !
For me, this
Hi Alistair.
I don't think anybody is annoyed by you. You are doing really good job. And
nice thing that you are super patient to continue :)
What I try to understand is why blocking atEnd is bad?
Here is code from VMMaker:
[stdin atEnd] whileFalse:
[| nextChunk |
stdout nextPutAll: 'squeak> ';
Hi Sven,
Oh dear. I feel as though I'm not getting my concerns across at all
well, and I'm pushing hard enough that all I'm going to do is make
people annoyed. So let me try to restate the issue one last time
before answering your questions directly.
Pharo & Squeak have unwritten rules about
> On 11 Apr 2018, at 10:29, Alistair Grant wrote:
>
> Hi Denis,
>
> On 11 April 2018 at 10:02, Denis Kudriashov wrote:
>>
>> 2018-04-11 8:32 GMT+02:00 Alistair Grant :
>>>
>> Where is it being said that #next and/or
Hi Denis,
On 11 April 2018 at 10:02, Denis Kudriashov wrote:
>
> 2018-04-11 8:32 GMT+02:00 Alistair Grant :
>>
>> >>> Where is it being said that #next and/or #atEnd should be blocking or
>> >>> non-blocking ?
>> >>
>> >> There is existing code that
2018-04-11 8:32 GMT+02:00 Alistair Grant :
> >>> Where is it being said that #next and/or #atEnd should be blocking or
> non-blocking ?
> >>
> >> There is existing code that assumes that #atEnd is non-blocking and
> >> that #next is allowed block. I believe that we should
Hi Sven,
On 10 April 2018 at 23:54, Sven Van Caekenberghe wrote:
> Alistair,
>
> I am replying in-between, please don't take my remarks as being negative, I
> just like to straighten things out as clear as possible.
No problem.
>> On 10 Apr 2018, at 22:14, Alistair Grant
Alistair,
I am replying in-between, please don't take my remarks as being negative, I
just like to straighten things out as clear as possible.
> On 10 Apr 2018, at 22:14, Alistair Grant wrote:
>
> Hi Sven,
>
> On 10 April 2018 at 19:36, Sven Van Caekenberghe
Hi Sven,
On 10 April 2018 at 19:36, Sven Van Caekenberghe wrote:
> I have trouble understanding your problem analysis, and how your proposed
> solution, would solve it.
The discussion started with my proposal to modify the Zinc streams to
check the return value of #next for nil
I have trouble understanding your problem analysis, and how your proposed
solution, would solve it.
Where is it being said that #next and/or #atEnd should be blocking or
non-blocking ?
How is this related to how EOF is signalled ?
It seems to me that there are quite a few classes of streams
First a quick update:
After doing some work on primitiveFileAtEnd, #atEnd now answers
correctly for files that don't report their size correctly, e.g.
/dev/urandom and /proc/cpuinfo, whether the files are opened directly or
redirected through stdin.
However determining whether stdin from a
Thanks for this discussion.
On Wed, Apr 4, 2018 at 1:37 PM, Sven Van Caekenberghe wrote:
> Alistair,
>
> First off, thanks for the discussions and your contributions, I really
> appreciate them.
>
> But I want to have a discussion at the high level of the definition and
>
On Wednesday 04 April 2018 09:07 PM, Sven Van Caekenberghe wrote:
Good summary, I agree.
Still, what are the semantics of #next - does the caller always have
to check for nil ? Do we think this is ugly (as the return value is
outside the domain) ? Do we then still need #atEnd ?
Senders of
On Wed, Apr 4, 2018 at 8:37 AM, Sven Van Caekenberghe wrote:
>
>
> > On 4 Apr 2018, at 17:32, K K Subbu wrote:
> >
> > On Wednesday 04 April 2018 04:06 PM, Nicolas Cellier wrote:
> >>> IIRC, someone said it is implemented as 'remaining size being zero'
> >>>
> On 4 Apr 2018, at 17:32, K K Subbu wrote:
>
> On Wednesday 04 April 2018 04:06 PM, Nicolas Cellier wrote:
>>> IIRC, someone said it is implemented as 'remaining size being zero'
>>> and some virtual unix files like /dev/random are zero sized.
>> Currently, for files
On Wednesday 04 April 2018 04:06 PM, Nicolas Cellier wrote:
IIRC, someone said it is implemented as 'remaining size being zero'
and some virtual unix files like /dev/random are zero sized.
Currently, for files other than sdio (stdout, stderr, stdin) it is
effectively defined as:
atEnd :=
Alistair,
First off, thanks for the discussions and your contributions, I really
appreciate them.
But I want to have a discussion at the high level of the definition and
semantics of the stream API in Pharo.
> On 4 Apr 2018, at 13:20, Alistair Grant wrote:
>
> On 4
On 4 April 2018 at 12:56, Sven Van Caekenberghe wrote:
> Playing a bit devil's advocate, the idea is that, in general,
>
> [ stream atEnd] whileFalse: [ stream next. "..." ].
>
> is no longer allowed ?
It hasn't been allowed "forever" [1]. It's just been misused for
almost as
Playing a bit devil's advocate, the idea is that, in general,
[ stream atEnd] whileFalse: [ stream next. "..." ].
is no longer allowed ? And you want to replace it with
[ stream next ifNil: [ false ] ifNotNil: [ :x | "..." true ] whileTrue.
That is a pretty big change, no ?
I think/feel like
Hi Nicolas,
On 4 April 2018 at 12:36, Nicolas Cellier
wrote:
>
>
> 2018-04-04 12:18 GMT+02:00 Alistair Grant :
>>
>> Hi Sven,
>>
>> On Wed, Apr 04, 2018 at 11:32:02AM +0200, Sven Van Caekenberghe wrote:
>> > Somehow, somewhere there was
2018-04-04 12:18 GMT+02:00 Alistair Grant :
> Hi Sven,
>
> On Wed, Apr 04, 2018 at 11:32:02AM +0200, Sven Van Caekenberghe wrote:
> > Somehow, somewhere there was a change to the implementation of the
> > primitive called by some streams' #atEnd.
>
> That's a proposed
Hi Sven,
On Wed, Apr 04, 2018 at 11:32:02AM +0200, Sven Van Caekenberghe wrote:
> Somehow, somewhere there was a change to the implementation of the
> primitive called by some streams' #atEnd.
That's a proposed change by me, but it hasn't been integrated yet. So
the discussion below should
Hi.
#next returning nil is definitely looks bad because we will always have
case when nil value will not means the end:
#(1 nil 2) readSteam next; next; atEnd
But I understand that in many cases analysing #next for nil is much more
suitable than #atEnd. I am sure that it can be always avoided
> On 4 Apr 2018, at 11:38, Nicolas Cellier
> wrote:
>
> Hi Sven,
> See also discussion at
> https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/232
Thanks Nicolas, I had already seen parts of it.
Now, I still want image level changes to be based on
Hi Sven,
See also discussion at
https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/232
2018-04-04 11:32 GMT+02:00 Sven Van Caekenberghe :
> Somehow, somewhere there was a change to the implementation of the
> primitive called by some streams' #atEnd.
>
> IIRC, someone said it
59 matches
Mail list logo