bug-apl
[Top][All Lists]
Advanced

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

Re: [Bug-apl] ^C ATTENTION


From: Juergen Sauermann
Subject: Re: [Bug-apl] ^C ATTENTION
Date: Sun, 11 Oct 2015 11:40:40 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

Hi Louis,

could you also provide a matrix M for which this happens?

I tried:

{⊃∨/1 ⍵∧3 4=+/+⌿¯1 0 1∘.⊖¯1 0 1⌽¨⊂⍵} ⍣≡ M←50>?10 10⍴100
^CATTENTION
λ1[1]  λ←⊃∨/1 ⍵∧3 4=+/+⌿¯1 0 1∘.⊖¯1 0 1⌽¨⊂⍵

several times on my machine and ^C always stopped it when it hung. And what is your platform?

/// Jürgen


On 10/11/2015 12:49 AM, Louis de Forcrand wrote:


Begin forwarded message:

From: Louis de Forcrand <address@hidden>
Subject: Re: [Bug-apl] ^C ATTENTION
Date: 10 Oct 2015 02:03:22 CEST
To: Juergen Sauermann <address@hidden>

Jürgen,

Sorry for the delay.

If I declare a LIFE function for finding the next generation in the game of life:

    ∇
[0]   λ←LIFE ⍵
[1]   λ←⊃∨/1 ⍵∧3 4=+/+⌿¯1 0 1∘.⊖¯1 0 1⌽¨⊂⍵
    ∇

and then call it on a matrix M:

LIFE ⍣≡ M

it should find the final state of M (if it exists!) after which it won’t change anymore when fed into LIFE (right?).
The problem is when it never reaches a “static” state, then it won’t stop without intervention. This is where I’ve
tried using ^C (pressing once, and pressing twice in a row), and neither seemed to halt the process.
I imagine the primitive to modify is ⍣?

PS: Gmane seems quite slow these days. Or is it on my side?

Best of luck,
⊣ Louis

On 03 Oct 2015, at 12:21, Juergen Sauermann <address@hidden> wrote:

Hi Louis,

could you  provide a concrete example?

Some remarks on ^C in GNU APL. There are two levels: a single ^C (called ATTENTION) and two ^C
within one second (called INTERRUPT).

ATTENTION is primarily checked by the runtime parser at the end of the line. This is to make
→N work nicely so that the interrupted line is finished before execution is stopped.

INTERRUPT is currently checked in printouts so that the display of long values can be aborted.
In general INTERUPT has a potential of leaving behind an inconsistent workspace and, if
checked to often, of performance impact. Therefore an example would be handy so that I
can see which (and where) an operation could be stopped in a reasonable way.

/// Jürgen


On 10/01/2015 10:26 PM, Louis de Forcrand wrote:
I've noticed that CONTROL-C works quite well with 
multiple-line functions, but not nearly as well with 
programs that use ⍣ for example (one-liners).
APL just seems to freeze, and with a little luck it 
stops and prints ATTENTION, while at other times
it just doesn't seem to stop at all.





reply via email to

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