Search code examples
exitaplgnu-apl

How do I exit GNU APL?


"I am stuck and cannot escape." - jclancy

I've been using Dyalog workspaces to play with APL, but wanted to try it out on the CLI, so I downloaded GNU APL from homebrew to check it out. Works great!

Unfortunately, once launched, I can't figure out how to quit or even suspend the REPL.

I have tried:

  • Searching the docs for the word "quit" ... it does not appear. (In the TOC, there's a section called "starting the REPL", but none called "stopping the REPL");
  • I tried running these commands: )QUIT, )EXIT, )STOP, )BYE, )DONE with prefixes of both ) and ], and no prefix at all;
  • ctrl-C, ctrl-D, ctrl-Z are all disabled;
  • I even tried ctrl-x ctrl-c and esc :q, just in case (they don't do anything).

(As a workaround, kill -9 $pid did of course work and was rather satisfying).


Solution

  • It is in the docs: section 1.2. (Keywords "stop" or "exit" – you were close!)

    1.2 Starting APL

    Last things first: before explaining how to start APL, it is important to remember how to stop (i.e. exit) it. Neither ^C nor ^D will stop APL - they serve other purposes. Instead, you leave APL with the command )OFF (on a separate line) like this:

    )OFF
    

    If APL is computing a function (and possibly caught in an endless loop), then you may have to press ^C (called ATTENTION in APL) in order to return to APL’s command mode and then give the )OFF command.