Hi,

The expressions for "a" and "b" yield the proper results:

*    a← (⊂¨ 2 2 ⍴⊂,¨2 2 ⍴⍬ )**
     b← (⊃¨⊂¨ 2 2 ⍴⊂,¨2 2 ⍴⍬ ) **/⍝⊃¨a/*

/⍝ The disclose in "b" works as expected/
*'ab',¨ ⊂¨ 3 ⎕CR ¨ a b /⍝ expression to represent "a" and "b" in one line. /*
a  ┏━━━━━━━━━┓ ┏━━━━━━━━━┓    b  ┏→━━━━━━┓ ┏→━━━━━━┓
    ┃┏→━━━━━━┓┃ ┃┏→━━━━━━┓┃       ↓┏→┓ ┏→┓┃ ↓┏→┓ ┏→┓┃
    ┃↓┏→┓ ┏→┓┃┃ ┃↓┏→┓ ┏→┓┃┃       ┃┃0┃ ┃0┃┃ ┃┃0┃ ┃0┃┃
    ┃┃┃0┃ ┃0┃┃┃ ┃┃┃0┃ ┃0┃┃┃       ┃┗━┛ ┗━┛┃ ┃┗━┛ ┗━┛┃
    ┃┃┗━┛ ┗━┛┃┃ ┃┃┗━┛ ┗━┛┃┃       ┃┏→┓ ┏→┓┃ ┃┏→┓ ┏→┓┃
    ┃┃┏→┓ ┏→┓┃┃ ┃┃┏→┓ ┏→┓┃┃       ┃┃0┃ ┃0┃┃ ┃┃0┃ ┃0┃┃
    ┃┃┃0┃ ┃0┃┃┃ ┃┃┃0┃ ┃0┃┃┃       ┃┗━┛ ┗━┛┃ ┃┗━┛ ┗━┛┃
    ┃┃┗━┛ ┗━┛┃┃ ┃┃┗━┛ ┗━┛┃┃       ┗ϵ━━━━━━┛ ┗ϵ━━━━━━┛
    ┃┗ϵ━━━━━━┛┃ ┃┗ϵ━━━━━━┛┃
    ┗ϵϵ━━━━━━━┛ ┗ϵϵ━━━━━━━┛       ┏→━━━━━━┓ ┏→━━━━━━┓
    ┏━━━━━━━━━┓ ┏━━━━━━━━━┓       ↓┏→┓ ┏→┓┃ ↓┏→┓ ┏→┓┃
    ┃┏→━━━━━━┓┃ ┃┏→━━━━━━┓┃       ┃┃0┃ ┃0┃┃ ┃┃0┃ ┃0┃┃
    ┃↓┏→┓ ┏→┓┃┃ ┃↓┏→┓ ┏→┓┃┃       ┃┗━┛ ┗━┛┃ ┃┗━┛ ┗━┛┃
    ┃┃┃0┃ ┃0┃┃┃ ┃┃┃0┃ ┃0┃┃┃       ┃┏→┓ ┏→┓┃ ┃┏→┓ ┏→┓┃
    ┃┃┗━┛ ┗━┛┃┃ ┃┃┗━┛ ┗━┛┃┃       ┃┃0┃ ┃0┃┃ ┃┃0┃ ┃0┃┃
    ┃┃┏→┓ ┏→┓┃┃ ┃┃┏→┓ ┏→┓┃┃       ┃┗━┛ ┗━┛┃ ┃┗━┛ ┗━┛┃
    ┃┃┃0┃ ┃0┃┃┃ ┃┃┃0┃ ┃0┃┃┃       ┗ϵ━━━━━━┛ ┗ϵ━━━━━━┛
    ┃┃┗━┛ ┗━┛┃┃ ┃┃┗━┛ ┗━┛┃┃
    ┃┗ϵ━━━━━━┛┃ ┃┗ϵ━━━━━━┛┃
    ┗ϵϵ━━━━━━━┛ ┗ϵϵ━━━━━━━┛



The expression for "c" yields the proper result
The expression for "d" yields an unexpected result - or is it intended?
The expression for "e" yields the result expected by "d":

*    c←(⊂¨ 2 2 ⍴0/¨⊂,¨2 2 ⍴ 0⍴0)**
     d←(⊃¨⊂¨ 2 2 ⍴0/¨⊂,¨2 2 ⍴ 0⍴0) /⍝ ⊃¨c/
     e← (⊂¨⊃¨⊂¨ 2 2 ⍴0/¨⊂,¨2 2 ⍴ 0⍴0)*///*⍝ ⊂¨⊃¨c expected by d*//
//
⍝ Zero rank elements stem from /*0/¨.*
/
⍝ The result from disclose in "d" is unexpected, I expected the output like in "e". ⍝ The left most enclose /*⊂¨*/in "e" should not be required to get the proper rank/depth.

⍝ In a more complex variable structure having "a" and "c" elements
⍝ the application of a uniform disclose over each element
⍝ results in "⊃¨a" >> "b" and "⊃¨c" >> "d" elements
⍝ finally causing a domain error.

⍝ If  the disclose //in the more complex variable structure //would result in "⊃¨a" >> "b" and "⊃¨c" >> "e" then the //domain error disappears.

⍝ Currently I have to check each element within the variable data structure and transform "d" to "e" where applicable.
//
⍝ Remark: I did some text editing here due to "/⊖/" being two chars wide. The APL output is correct./ *'cde',¨ ⊂¨3 ⎕CR ¨ c d e**/⍝ expression to represent "c", "d" and "e" in one line./*
 c  ┏━━━━━┓ ┏━━━━━┓    d  ┏⊖┓┏⊖┓    e ┏━━━┓ ┏━━━┓
    ┃┏⊖━━┓┃┃┏⊖━━┓┃      ↓0┃  ↓0┃      ┃┏⊖┓┃ ┃┏⊖┓┃
    ┃↓┏→┓┃┃ ┃↓┏→┓┃┃       ┃0┃ ┃0┃       ┃↓0┃┃ ┃↓0┃┃
    ┃┃┃0┃┃┃ ┃┃┃0┃┃┃       ┗━┛ ┗━┛       ┃┃0┃┃ ┃┃0┃┃
    ┃┃┗━┛┃┃ ┃┃┗━┛┃┃                     ┃┗━┛┃ ┃┗━┛┃
    ┃┃┏→┓┃┃ ┃┃┏→┓┃┃       ┏⊖┓┏⊖┓      ┗ϵ━━┛ ┗ϵ━━┛
    ┃┃┃0┃┃┃ ┃┃┃0┃┃┃       ↓0┃ ↓0┃       ┏━━━┓ ┏━━━┓
    ┃┃┗━┛┃┃ ┃┃┗━┛┃┃       ┃0┃ ┃0┃       ┃┏⊖┓┃┃┏⊖┓┃
    ┃┗ϵ━━┛┃ ┃┗ϵ━━┛┃       ┗━┛ ┗━┛       ┃↓0┃┃ ┃↓0┃┃
    ┗ϵϵ━━━┛ ┗ϵϵ━━━┛                     ┃┃0┃┃ ┃┃0┃┃
    ┏━━━━━┓ ┏━━━━━┓                     ┃┗━┛┃ ┃┗━┛┃
    ┃┏⊖━━┓┃┃┏⊖━━┓┃                    ┗ϵ━━┛ ┗ϵ━━┛
    ┃↓┏→┓┃┃ ┃↓┏→┓┃┃
    ┃┃┃0┃┃┃ ┃┃┃0┃┃┃
    ┃┃┗━┛┃┃ ┃┃┗━┛┃┃
    ┃┃┏→┓┃┃ ┃┃┏→┓┃┃
    ┃┃┃0┃┃┃ ┃┃┃0┃┃┃
    ┃┃┗━┛┃┃ ┃┃┗━┛┃┃
    ┃┗ϵ━━┛┃ ┃┗ϵ━━┛┃
    ┗ϵϵ━━━┛ ┗ϵϵ━━━┛



An observed side effect:
Placing the expression from a, b, c, d, and e in one line generates as SYSTEM LIMIT:

 3 ⎕CR ¨(⊂¨ 2 2 ⍴⊂,¨2 2 ⍴⍬) (⊃¨⊂¨ 2 2 ⍴⊂,¨2 2 ⍴⍬) (⊂¨ 2 2 ⍴0/¨⊂,¨2 2 ⍴ 0⍴0) (⊃¨⊂¨ 2 2 ⍴0/¨⊂,¨2 2 ⍴ 0⍴0) (⊂¨⊃¨⊂¨ 2 2 ⍴0/¨⊂,¨2 2 ⍴ 0⍴0)
SYSTEM LIMIT (fun_oper)
     3 ⎕CR¨(⊂¨2 2⍴⊂,¨2 2⍴⍬)(⊃¨⊂¨2 2⍴⊂,¨2 2⍴⍬)(⊂¨2 2⍴0/¨⊂,¨2 2⍴0⍴0)(⊃¨⊂¨2 2⍴0/¨⊂,¨2 2⍴0⍴0)(⊂¨⊃¨⊂¨2 2⍴0/¨⊂,¨2 2⍴0⍴0)


Related problems:

*≡¨a b c d e*
4 3 4 2 3 /⍝ ≡d should be 3

/* ⍴¨¨¨¨c*
DOMAIN ERROR
     ⍴¨¨¨¨c
     ^    ^

/⍝ ¨¨¨¨ (4 times each) corresponds to 4 ←→ ≡c, the //DOMAIN ERROR//is not expected (works with ⍴¨¨¨¨a). /

Best Regards
Hans-Peter





Reply via email to