[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-apl] IOTA
From: |
Jay Foad |
Subject: |
Re: [Bug-apl] IOTA |
Date: |
Thu, 3 Mar 2016 08:05:52 +0000 |
Right. Here's a variation on Elias's solution that gets IOTA ⍬ right,
but doesn't handle the singleton cases correctly!
IOTA ← {⊃∘.,/(⍳¨⍵),⊂⊂⍬}
On 3 March 2016 at 01:08, Nick Lobachevsky <address@hidden> wrote:
> There is at least one other degenerate case, namely the "legacy"
> singleton, or one element vector. With a scalar argument, monadic
> iota returns a result depth one. With a vector argument, iota returns
> a result depth two. Except when there is only one element.
>
> ≡⍳⍳0 ⍝ can't find zilde
> 2
> ≡⍳⍳1 ⍝ singleton vector case returns result depth one
> 1
> ≡⍳,1
> 1
> ≡⍳,2
> 1
> ≡⍳,42
> 1
> ≡⍳(15⍴1)⍴1 ⍝ matrix singleton thankfully fails
> RANK ERROR
> ≡⍳⍳2
> 2
- [Bug-apl] IOTA, Christian Robert, 2016/03/01
- Re: [Bug-apl] IOTA, Elias Mårtenson, 2016/03/01
- Re: [Bug-apl] IOTA, Elias Mårtenson, 2016/03/01
- Re: [Bug-apl] IOTA, Christian Robert, 2016/03/01
- Re: [Bug-apl] IOTA, Jay Foad, 2016/03/02
- Re: [Bug-apl] IOTA, Elias Mårtenson, 2016/03/02
- Re: [Bug-apl] IOTA, Nick Lobachevsky, 2016/03/02
- Re: [Bug-apl] IOTA,
Jay Foad <=
- Re: [Bug-apl] IOTA, Elias Mårtenson, 2016/03/03
- Re: [Bug-apl] IOTA, Jay Foad, 2016/03/03
- Re: [Bug-apl] IOTA, Juergen Sauermann, 2016/03/03
- Re: [Bug-apl] IOTA, Jay Foad, 2016/03/03
- Re: [Bug-apl] IOTA, Kacper Gutowski, 2016/03/03
- Re: [Bug-apl] IOTA, Juergen Sauermann, 2016/03/03
- Re: [Bug-apl] IOTA, Elias Mårtenson, 2016/03/03
- Re: [Bug-apl] IOTA, Juergen Sauermann, 2016/03/03
- Re: [Bug-apl] IOTA, Juergen Sauermann, 2016/03/03
- Re: [Bug-apl] IOTA, Mike Duvos, 2016/03/03