Hi,
Your ⎕IO is 0
⎕IO←1
Display (2 2 ⍴ 104 105 106 107) ⍳ (3 4 ⍴ 100+⍳100)
┏→━━━━━━━━━━━━━━━━━━━━━━┓
↓┏⊖┓ ┏⊖┓ ┏⊖┓ ┏→━━┓┃
┃┃0┃ ┃0┃ ┃0┃ ┃1 1┃┃
┃┗━┛ ┗━┛ ┗━┛ ┗━━━┛┃
┃┏→━━┓ ┏→━━┓ ┏→━━┓ ┏⊖┓ ┃
┃┃1 2┃ ┃2 1┃ ┃2 2┃ ┃0┃ ┃
┃┗━━━┛ ┗━━━┛ ┗━━━┛ ┗━┛ ┃
┃┏⊖┓ ┏⊖┓ ┏⊖┓ ┏⊖┓ ┃
┃┃0┃ ┃0┃ ┃0┃ ┃0┃ ┃
┃┗━┛ ┗━┛ ┗━┛ ┗━┛ ┃
┗∊━━━━━━━━━━━━━━━━━━━━━━┛
⍝ this is the shape of the right argument and their indexes within the
left argument.
(2 2 ⍴ 104 105 106 107) (3 4 ⍴ 100+⍳12)
104 105 101 102 103 104
106 107 105 106 107 108
109 110 111 112
furthermore:
104 105 106 107 ⍳ 3 4 ⍴ 100+⍳12
5 5 5 1
2 3 4 5
5 5 5 5
so may be
(2 2 ⍴ 104 105 106 107) ⍳ (3 4 ⍴ 100+⍳100)
should be
┏→━━━━━━━━━━━━━━━━━━━━━━┓
↓┏→━━┓ ┏→━━┓ ┏→━━┓ ┏→━━┓┃
┃┃3 3┃ ┃3 3┃ ┃3 3┃ ┃1 1┃┃
┃┗━━━┛ ┗━━━┛ ┗━━━┛ ┗━━━┛┃
┃┏→━━┓ ┏→━━┓ ┏→━━┓ ┏→━━┓┃
┃┃1 2┃ ┃2 1┃ ┃2 2┃ ┃3 3┃┃
┃┗━━━┛ ┗━━━┛ ┗━━━┛ ┗━━━┛┃
┃┏→━━┓ ┏→━━┓ ┏→━━┓ ┏→━━┓┃
┃┃3 3┃ ┃3 3┃ ┃3 3┃ ┃3 3┃┃
┃┗━━━┛ ┗━━━┛ ┗━━━┛ ┗━━━┛┃
┗∊━━━━━━━━━━━━━━━━━━━━━━┛
Regards
Hans-Peter
Am 14.04.20 um 11:30 schrieb Jay Foad:
Just from staring at the result, it looks like the result of ⍺⍳⍵ has
the same shape as ⍵, and for each item of ⍵ it tells you either the
coordinates where it was found in ⍺, or ⍬ if it was not found. (Dunno
what it does if ⍺ is a scalar, where ⍬ would be a valid coordinate.)
N.B. in Dyalog APL dyadic iota has been extended to high rank arrays
in a completely different way:
https://help.dyalog.com/17.1/#Language/Primitive%20Functions/Index%20Of.htm
Jay.
On Tue, 14 Apr 2020 at 09:15, Elias Mårtenson <loke...@gmail.com
<mailto:loke...@gmail.com>> wrote:
The ISO spec doesn't address what the index-of function should do
when the left argument is not a scalar or a one-dimensional array.
GNU APL extends this, but I don't really understand in what way.
How am I to interpret the output from this?
* (2 2 ⍴ 104 105 106 107) ⍳ (3 4 ⍴ 100+⍳100)*
┏→━━━━━━━━━━━━━━━━━━━━━━┓
↓┏⊖┓ ┏⊖┓ ┏⊖┓ ┏⊖┓ ┃
┃┃0┃ ┃0┃ ┃0┃ ┃0┃ ┃
┃┗━┛ ┗━┛ ┗━┛ ┗━┛ ┃
┃┏→━━┓ ┏→━━┓ ┏→━━┓ ┏→━━┓┃
┃┃0 0┃ ┃0 1┃ ┃1 0┃ ┃1 1┃┃
┃┗━━━┛ ┗━━━┛ ┗━━━┛ ┗━━━┛┃
┃┏⊖┓ ┏⊖┓ ┏⊖┓ ┏⊖┓ ┃
┃┃0┃ ┃0┃ ┃0┃ ┃0┃ ┃
┃┗━┛ ┗━┛ ┗━┛ ┗━┛ ┃
┗∊━━━━━━━━━━━━━━━━━━━━━━┛
Regards,
Elias