bug-apl
[Top][All Lists]
Advanced

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

Re: [Bug-apl] APL Questions


From: Kacper Gutowski
Subject: Re: [Bug-apl] APL Questions
Date: Mon, 14 Sep 2015 15:00:04 +0200

On Sun, Sep 13, 2015 at 11:53 PM, Louis de Forcrand <address@hidden> wrote:
> Is it possible to terminate a function while it's running
> (eg. when you accidentally set a very large number
> as an operand)?

Pressing Control-C should signal ATTENTION which should suspend
execution of current function.

> I read a bit of the APLX online manual just before posting,
> and I think ⍞ does this, right?

Yes.

> Edit a specific line in a function? As of now I'm writing my
> long ∇-declared functions in in .txt files and loading them
> with -f, otherwise I would have to rewrite (or copy-paste)
> them back in line by line in the terminal.
> From what I understand, the APLX manual also says that it
> is possible to do this with ⍎'∇FN[3]←A+1', for example, which
> would change line 3 of function FN to A+1. I don't think this
> works in GNU APL though.

If you want to manipulate the definition automatically, you can take
its S←⎕CR'FN', change it, and then call ⎕FX S. The ∇ editor is an
interactive feature and you can't use it in ⍎.

APLX Language Manual you mentioned has a chapter briefly describing
editor's commands.  After you enter the editor with ∇name you can
change to desired line with [3] command and then enter the text that
should replace that line.  You can put the first editor command
directly after the header in the same line.  Changing 3rd line would
look like this in interactive session:

      ∇FN[3]
[3] A+1∇

Hitting enter after header line is required, and the second [3] in
the first column is a prompt from the editor.

> What does the ⍫ (lock) symbol do to functions, and how do
> I use it?

When you use ⍫ instead of ∇ to close the editor, the function becomes
locked, i.e. you can can't edit it, ⎕CR gives empty array, and any
errors encountered when executing that function will be reported as
if it were a primitive function without suspending execution inside
it or showing you its code.

-k



reply via email to

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