|
From: | Elias Mårtenson |
Subject: | Re: [Bug-apl] is there a )copy ⎕fns like ⎕e x is )erase |
Date: | Sat, 26 Apr 2014 21:15:43 +0800 |
On 2014-04-26 12:08:14, Juergen Sauermann wrote:I like a lot that there is now a command that sources another file
> I could make the ∇-editor aware that a )COPY is in progress and that
> functions shall be deleted automatically by the ∇-editor.
raw, much like "." in shell or "#include" in cpp. It's all that is
needed to make more complex programs/libraries in forms of
UNIX-ish-style scripts without relying on (hardly readable) workspace
files.
With this mindset I find any changes to behaviour highly unexpected
and I would probably report them as a bugs (unless properly documented
as an actual features, of course). It might not be a problem in case
of ∇, but for updating already defined function it's an overkill as it
can be easily done explicitly by programmer like that:
∇mean[0]
R←mean B
R←(+/B)÷⍴B
∇
This can be )COPY-ied many times without any problems as it enters the
editor with a name only and then explicitly rewrites header line at [0].
As for implementing )EDIT-like routine, in other systems it launches
editor with a function body only, not ∇-editor commands.
So I think it might be a good idea to dump function's ⎕CR to a
temporary file and then launch external editor on it. When done
editing, read it back, split by lines, and simply pass it to ⎕FX.
Maybe also ⎕EX FN when ⎕FX returns success with a different name,
and)COPY/)DUMP to destination file as appropriate.
[Prev in Thread] | Current Thread | [Next in Thread] |