On Sun, Feb 02, 2020 at 03:17:17AM +0000, Aaron Sloman wrote:
> I have been trying to understand why it is no longer possible to start the
> Popracer package from the linux command line, or from the pop11 prompt,
> though it works if read into the editor and compiled there.
> 
> I think the problem is due to faulty initialisation of terminal handling in
> the early startup phase of V16, whose effects go far beyond Popracer.
> 
> I have tested popracer using the latest 32 bit poplog still available
> here:
> 
>       https://www.cs.bham.ac.uk/research/projects/poplog/latest-poplog/
> 
> and it works as expected if run in the popracer directory as:
> 
>       pop11 main.p
> 
> but in poplog V16 that generates an endless loop repeatedly printing out
> the 'Command' prompt (after some instructions have gone off the top of the
> screen).
> 
> I've confirmed that the problem is not confined to popracer, as I'll try to
> explain:
> 
> Some input processing invoked from the linux command line works as expected
> in V16, e.g.
> 
>    % pop11 :"charin()=>"
>    : A
>    ** 65
>    % pop11 :"charin()=>"
>    : 0
>    ** 48
> 
> But not this:
> 
>    % pop11 :"readline()=>"
> 
> prints the end of stream indicator:
> 
>       ** <termin>

I do not understand why you think that you should get anything different?
'readline()' reads from proglist and proglist is read from the same
string as 'readline()=>'.  So we are at the end of input and '<termin>'
is correct.

I agree that this is undesirable, but it is logical consequence
of Poplog design choices.

> Whereas if I use the latest 32 bit poplog (v15.65), available from
> 
>       http://www.cs.bham.ac.uk/research/projects/poplog/latest-poplog
> 
> then readline()=> behaves as expected -- the '?' input prompt is printed, a
> line of text read in, made into a list, and printed out:
> 
>       %  pop11 :"readline()=>"
>       ? the cat is on the mat
>       ** [the cat is on the mat]

I slightly doubt that this is plan pop11 (as opposed to say Ved).
I have trouble running 32-bit binaries, but old 32-bit corepop
also gives '<termin>'.

> However readline works in V16 if readline if it is invoked AFTER the pop11
> prompt has been printed (i.e. after Setpop, not on the linux command line):
> 
>     % pop11
> 
>     Sussex Poplog (Version 16.0 Thu 23 Jan 20:46:14 GMT 2020)
>     Copyright (c) 1982-1999 University of Sussex. All rights reserved.
> 
>     Setpop
>     : readline()=>
>     ? this should work
>     ** [this should work]

Yes, now proglist comes from parsing user input from terminal.
 
> POPRACER EVIDENCE

I had no time to look at popracer, but problem must be a bit more
subtle.

-- 
                              Waldek Hebisch

Reply via email to