[Top][All Lists]

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

Re: seg-fault with deeply nested assignment

From: Rowan Cannaday
Subject: Re: seg-fault with deeply nested assignment
Date: Tue, 7 Apr 2020 16:08:09 -0400

thanks jurgen, i havent had time to pull latest and compile, but i appreciate the fix.

- Rowan

On Tue, Apr 7, 2020, 5:58 AM Blake McBride <address@hidden> wrote:
Thanks.  I saw that after I sent the email.  When I used APL, there was no APL2.  So, I've never used APL2 professionally.

I also see that the latest repo version has a fix for the original report.



On Tue, Apr 7, 2020 at 4:37 AM Dr. Jürgen Sauermann <mail@jürgen-sauermann.de> wrote:

actually it assigns a new value (6 7 in the example) to a part of x. Even though ⊃⊃x is a temporarym
the assignment changes the original x.

I suppose IBM APL2 does the same.

BR, Jürgen

On 4/7/20 1:28 AM, Blake McBride wrote:
Without assigning it to a variable, I don't see what sense the statement even makes.


produces an intermediate value.  I can't think of what sense making an assignment to an intermediate value even does.

I think APL should just throw a syntax error as in:

      (+/10 10⍴⍳100)[2]←4
      (+/10 10⍴⍳100)[2]←4
      ^                ^

(Surely a syntax error is more appropriate than a segfault!)

What does IBM APL do?


On Sat, Apr 4, 2020 at 5:03 PM Rowan Cannaday <address@hidden> wrote:
hello y'all, hope everyone is staying safe.

      x ← 1 (2 3 (4 5))        
      (⊃⊃x)[2;3;] ← 6 7


-- Stack trace at main.cc:88
0x7F032D7BABBB __libc_start_main
0x557F8B045425  main
0x557F8B1BE755   Workspace::immediate_execution(bool)
0x557F8B099A4B    Command::process_line()
0x557F8B09A45A     Command::do_APL_expression(UCS_string&)
0x557F8B099AE8      Command::finish_context()
0x557F8B0A3698       Executable::execute_body() const
0x557F8B159D4C        StateIndicator::run()
0x557F8B0DB23D         Prefix::reduce_statements()
0x557F8B0DA17D          Prefix::reduce_MISC_F_B_()
0x557F8B0F1F4F           Bif_F12_PICK::eval_B(Value_P)
0x557F8B0EBB33            Bif_F12_PICK::disclose(Value_P, bool)
0x557F8B0EB86A             Bif_F12_PICK::compute_item_shape(Value_P, bool)

By the way, it works if you use an intermediary variable:

4 5
      y[2;3;] ← 5 6
1 0
0 0
0 0

2 0
3 0
5 6

 - Rowan

reply via email to

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