bug-apl
[Top][All Lists]
Advanced

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

Re: [Bug-apl] null as index does not extend to matrix


From: Juergen Sauermann
Subject: Re: [Bug-apl] null as index does not extend to matrix
Date: Tue, 14 Jul 2015 17:22:09 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

Hi Alex,

thanks, fixed in SVN 647.

/// Jürgen


On 07/14/2015 05:23 AM, address@hidden wrote:
Hi Bug APL,

The vector A can do index assignment when the index is a null:
      A←⍳3
      A
1 2 3
      A[0↑2 3]←0
      A
1 2 3

The matrix B does the same thing, only when both (for 2-D) indices in the matrix are null:
      B←3 3 ⍴⍳3
            B
1 2 3
1 2 3
1 2 3
      B[0↑1 2;0↑2 3]←0
      B

1 2 3
1 2 3
1 2 3


But if you have B[1;0↑2 3]←0  which "looks" like B[1;]←0 , but seems counter-intuitive because that is shorthand for B[1;1 2 3] ...the opposite of the null selection....  there is a large error:
==============================================================================
Assertion failed: pos < indices.size()
in Function:      get_value
in file:          IndexIterator.hh:112

Call stack:

----------------------------------------
-- Stack trace at IndexIterator.hh:112
----------------------------------------
0x7f14cea79ec5 __libc_start_main
0x4432d5  main
0x577b8d   Workspace::immediate_execution(bool)
0x48ce1a    Command::process_line()
0x48cef8     Command::do_APL_expression(UCS_string&)
0x497e9b      Executable::execute_body() const
0x524af0       StateIndicator::run()
0x4cd254        Prefix::reduce_statements()
0x4ce3e5         Prefix::reduce_V_C_ASS_B()
0x532c47          Symbol::assign_indexed(IndexExpr&, Value_P)
0x4a38a1           MultiIndexIterator::next()
0x4a3e47            
0x454682             do_Assert(char const*, char const*, char const*, int)
========================================

SI stack:

Depth:    0
Exec:     0x269a590
Safe ex:  no
Pmode:    ◊  B[1;0↑2 3]←0
PC:       10 ENDL
Stat:     B[1;0↑2 3]←0
err_code: 0x0
thrown:   at StateIndicator.cc:40
e_msg_1:  'No Error'
e_msg_2:  ''
e_msg_3:  ''


==============================================================================
      









reply via email to

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