bug-apl
[Top][All Lists]
Advanced

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

Re: [Bug-apl] History problem with GNU APL (not aplwrap)


From: Juergen Sauermann
Subject: Re: [Bug-apl] History problem with GNU APL (not aplwrap)
Date: Sat, 13 Sep 2014 12:21:23 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.0

Hi Blake,

this is actually on purpose. The reason is replay of (or cut-and-paste from) history files.

Previously (libreadline) only the opening of the function (∇test) would be stored in the history.
The subsequent lines would be eaten by the ∇-editor until the function was closed.

The new history outputs the entire function (so what you see in the )history is the entire function
definition which is only by chance similar to the output of the [⎕] command:

      ∇foo
[1] 11
[2] 22
[3] 33
[4] ∇

      )history
      ∇foo
          ∇foo
      [1]   11
      [2]   22
      [3]   33
          ∇


Looking at the above it seems like the first ∇foo in the history should be removed.

An interesting question is if, for example, ∇foo[⎕]∇ should be handled differently than foo
That sounds reasonable at first sight but then 
∇foo[⎕]∇ would be differrent from

∇foo
[⎕]∇

Another approach could be to not include func
tion definitions that don't change the definition.
But that would break

      )LOAD foo_ws
      ∇foo[⎕]∇


/// Jürgen


On 09/12/2014 10:28 PM, Blake McBride wrote:
Greetings,

Create a function like this:

      ∇test[⎕]∇
    ∇
[0]   test
[1]   abc
[2]   def
[3]   ghi
    ∇


Then type:

      45
45
      55
55
      ∇test[⎕]∇
[displays function]

So, the last thing you typed was the _single_ line to display the function.  If you hit the up-arrow key you would expect to see:

      ∇test[⎕]∇
      55
      45

but instead, somehow, the _output_ of the display function became _input_ history.  Not right.

Thanks.

Blake



reply via email to

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