Re: [Bug-apl] IOTA

2016-03-01 Thread Christian Robert
thank you very much, I now understand how it work ! looks so easy for you ;-) and so hard for me :-( Xtian. On 2016-03-01 21:43, Elias Mårtenson wrote: On 2 March 2016 at 10:28, Christian Robert mailto:christian.rob...@polymtl.ca>> wrote: IOTA ← {∘.,/⍳¨⍵} yes, it does the trick (you

Re: [Bug-apl] IOTA

2016-03-01 Thread Elias Mårtenson
On 2 March 2016 at 10:28, Christian Robert wrote: > IOTA ← {∘.,/⍳¨⍵} > > yes, it does the trick (you are really good btw) > I don't consider myself good. :-) Anyway, it's quite simple. Let me break it down: First of all, ¨⍳⍵ will simply create the individual iotas: * ⍳¨2 3 4* ┌→

Re: [Bug-apl] IOTA

2016-03-01 Thread Christian Robert
I see, but what is the "/" doing ? Xtian {⍳¨⍵} 1 ┌───┐ │┌→┐│ ││1││ │└─┘│ └∊──┘ {⍳¨⍵} 1 2 ┌2┐ │┌→┐ ┌2──┐│ ││1│ │1 2││ │└─┘ └───┘│ └∊┘ {⍳¨⍵} 1 2 3 ┌3┐ │┌→┐ ┌2──┐ ┌3┐│ ││1│ │1 2│ │1 2 3││ │└─┘ └───┘ └─┘│ └∊┘ {∘.,/⍳¨⍵} 1

Re: [Bug-apl] IOTA

2016-03-01 Thread Christian Robert
IOTA ← {∘.,/⍳¨⍵} yes, it does the trick (you are really good btw) but I had to disclose the result IOTA 2 3 5 ┌─┐ │┌5──┐│ │2┌3┐ ┌3┐ ┌3┐ ┌3┐ ┌3┐││ │││1 1 1│ │1 1 2│ │1 1 3│ │1 1 4│ │1 1 5│││ │3└

Re: [Bug-apl] IOTA

2016-03-01 Thread Elias Mårtenson
Looking at it further, I realise you need do disclose the result in order to make them equivalent: * IOTA ← {⊃∘.,/⍳¨⍵}* Regards, Elias On 2 March 2016 at 10:19, Elias Mårtenson wrote: > I don't know about a loop, but wouldn't this do the same thing? > > *IOTA ← {∘.,/⍳¨⍵}* > > Regards,

Re: [Bug-apl] IOTA

2016-03-01 Thread Elias Mårtenson
I don't know about a loop, but wouldn't this do the same thing? *IOTA ← {∘.,/⍳¨⍵}* Regards, Elias On 2 March 2016 at 09:57, Christian Robert wrote: > I have this function, > > ∇IOTA[⎕]∇ > ∇ > [0] z←IOTA v > [1] z←⍳↑v > [2] v←1↓,v > [3] Loop: →(0=⍴v)/0 > [4] z←z∘.,⍳↑v > [

[Bug-apl] IOTA

2016-03-01 Thread Christian Robert
I have this function, ∇IOTA[⎕]∇ ∇ [0] z←IOTA v [1] z←⍳↑v [2] v←1↓,v [3] Loop: →(0=⍴v)/0 [4] z←z∘.,⍳↑v [5] v←1↓v [6] →Loop ∇ ]boxing 24 IOTA 0 ┌⊖┐ │0│ └─┘ IOTA 10 ┌10──┐ │1 2 3 4 5 6 7 8 9 10│ └┘ IOTA 2 3 ┌3──