bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] problems with ^D


From: Juergen Sauermann
Subject: Re: [Bug-apl] problems with ^D
Date: Sat, 22 Aug 2015 13:52:12 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

Hi Jay,

this behavior is kind of intended, but I would be open for better solutions.

The underlying problem is this: GNU APL can run interactively or from a script.
But I have not found a reliable way to distinguish the two cases and I didn't want
to introduce a command line option for it either because I consider that as too
inconvenient for the user.

First of all, I thought that displaying the message 5 times would be enough for a human
(= interactive user) and continuing to display the message more often is simply bad
(because if that happens in a GNU APL script then it would blow up everything.

The rest then depends on the timing. If several ^Ds come in quickly then I assume a script is
running (actually finished) and has closed stdin. In that case I exit the interpreter because
a script that has not performed )OFF or ]NEXTFILE at this point has no chance to continue
and would hang if I would not exit the interpreter.

Otherwise (the ^Ds come in more slowly) I expect a human user (who was warned earlier
that he should use )OFF)

The message "EOF at Command.cc:65" is an indication that ^D was detected. Everything
entered before that message is being discarded (including a possibly entered command
like )OFF.).

/// Jürgen


On 08/21/2015 12:46 PM, Jay Foad wrote:
When I build and run GNU APL on Ubuntu 15.04, ^D seems to behave strangely.

1. The first four times I hit it I get "^D" echoed, followed by a
blank line and a helpful message. After that I just get "^D" echoed,
with no message at all. (I expected it to exit the interpreter if I
hit it n times in a row, for some value of n; this is what the bash
shell does when you set e.g. IGNOREEOF=10.)

      ^D

      ^D or end-of-input detected (1). Use )OFF to leave APL!
      ^D

      ^D or end-of-input detected (2). Use )OFF to leave APL!
      ^D

      ^D or end-of-input detected (3). Use )OFF to leave APL!
      ^D

      ^D or end-of-input detected (4). Use )OFF to leave APL!
      ^D
      ^D
      ^D

2. The next line I type after hitting ^D always seems to cause a
strange error in Command.cc:

      ^D

      ^D or end-of-input detected (1). Use )OFF to leave APL!
      )off
EOF at Command.cc:65
      )off

Goodbye.

I had to type )off twice here, because the first one just gave the EOF
error and didn't exit the interpreter.

Thanks,
Jay.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]