bug-apl
[
Top
][
All Lists
]
Advanced
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
][
Date Index
][
Thread Index
]
Re: [Bug-apl] IOTA
From
:
Elias Mårtenson
Subject
:
Re: [Bug-apl] IOTA
Date
:
Wed, 2 Mar 2016 10:43:50 +0800
On 2 March 2016 at 10:28, Christian Robert
<
address@hidden
>
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
┌→──────────────────────┐
│┌→──┐ ┌→────┐ ┌→──────┐│
││1 2│ │1 2 3│ │1 2 3 4││
│└───┘ └─────┘ └───────┘│
└∊──────────────────────┘
The
∘.,
function will take two lists, and apply the function
,
(concatenate) on each permutation:
(⍳2) ∘., (⍳3)
┌→────────────────┐
↓┌→──┐ ┌→──┐ ┌→──┐│
││1 1│ │1 2│ │1 3││
│└───┘ └───┘ └───┘│
│┌→──┐ ┌→──┐ ┌→──┐│
││2 1│ │2 2│ │2 3││
│└───┘ └───┘ └───┘│
└∊────────────────┘
You've probably seen the
∘.×
function used to create a multiplication table in a similar manner.
Finally, the
/
operator acts on a function and a list as if the function was placed between every element in the list. Thus:
∘., / (1 2) (1 2 3) (1 2 3 4)
will be equivalent to:
(1 2) ∘., (1 2 3) ∘., (1 2 3 4)
Regards,
Elias
reply via email to
[
Prev in Thread
]
Current Thread
[
Next in Thread
]
Re: [Bug-apl] IOTA
,
(continued)
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
Re: [Bug-apl] IOTA
,
Juergen Sauermann
,
2016/03/03
Re: [Bug-apl] IOTA
,
Mike Duvos
,
2016/03/06
Re: [Bug-apl] IOTA
,
Juergen Sauermann
,
2016/03/06
Re: [Bug-apl] IOTA
,
Christian Robert
,
2016/03/01
Re: [Bug-apl] IOTA
,
Elias Mårtenson
<=
Re: [Bug-apl] IOTA
,
Christian Robert
,
2016/03/01
Re: [Bug-apl] IOTA
,
Ala'a Mohammad
,
2016/03/03
Prev by Date:
Re: [Bug-apl] IOTA
Next by Date:
Re: [Bug-apl] IOTA
Previous by thread:
Re: [Bug-apl] IOTA
Next by thread:
Re: [Bug-apl] IOTA
Index(es):
Date
Thread