Well, its amazing what actually having the code can do....
the problem is what we thought it was, but pop doesn't implement it the
way I said (and I remember falling over this one before...). It is true
that pop exits on errors if the input isn't a terminal (which is what we
thought), but it doesn't do this by redefining *interrupt*, it does it
inside *setpop*. When setpop is called it tests standard input and if
its not a terminal it exits. So no amount of redefining interrupt to be
setpop will help. BUT setpop has this funny flag pop_first_setpop, which
disables this behaviour the first time its called. Lukcily for us, we
can set this flag ourselves and so fool setpop.
So do this:
define interrupt();
true -> pop_first_setpop;
setpop();
enddefine;
and you will find that mishaps get handled without exiting. (but it
still won't save you if someone explicitly calls setpop)
Roger
Developers note: it's not clear to me what pop_first_setpop is really
for - it may be a hang over from days when setpop was used to initialise
the system from cold, but it doesn't look as though it does that now. It
may be a bit risky to fiddle too much with it, but it looks as if it
would be pretty straightforward to add a command-line flag to force
interactive behaviour, and I think that might be a useful addition.
david moss wrote:
> Roger Evans wrote:
>
>> Hmm, I think my attempts at remote debugging are rather losing the
>> battle aren't they. I think i'd better leave you in more local hands....
>>
>> Roger
>>
>> david moss wrote:
>>
>>> Roger Evans wrote:
>>>
>>>> Ah, looks like you don't need the '+startup' in the command I
>>>> suggested for you - $pop_pop11 handles that bit for you. So try
>>>>
>>>> pop11 ":setpop -> interrupt; sysinitcomp(); setpop()"
>>>>
>>>> roger
>>>
>>>
>>>
>>>
>>> Tried that, but pop11 dies after setpop(); for reasons unknown (no
>>> mishap is thrown or any indication given). I know because I sent the
>>> commands individually to test where the problem was.
>>>
>>> david.
>>>
>>>
>>
>>
>>
>
> I have put the code for the java app I'm making in my web page (link
> below) It is *very* basic and its meant as a proof-of-concept, not as
> a proper development anything in the hope that someone will know what
> is going on.
>
> http://studentweb.cs.bham.ac.uk/~ug57dsm/jedit/PopConsole.tar.gz
>
> There is a makefile inside the .gz archive, just extract everything
> with "tar -xvzf PopConsole.tar.gz" and type "make run" to see it in
> action (assuming you have java properly set)
>
> try sending some commands, like [hello world]=> or pr('this does
> work');nl(1); which I know work. Then try the stuff that doesn't, like
> "x + 1;" (where 'x' is undefined) or setpop(); (which makes it exit
> with exitcode 0).
>
> Once poplog is made to work I can get on with hacking a proper app and
> then a plugin for jedit. :)
>
> Hope someone has better luck than me.
>
> regards,
>
> david.
>
> PS, the file Test.java in the root directory contains the main()
> method. Inside this there are a series of commented lines which you
> can swap around to check different incantations of poplog or bash at
> your leisure.
|