there is also,
iota =: i. : (+ i.)
3 iota 5
3 4 5 6 7
([ iota >:@-~)/ 3 7
3 4 5 6 7
3 iota _5
7 6 5 4 3
From: Joe Bogner
To: programm...@jsoftware.com
Sent: Friday, April 6, 2018 3:50 PM
Subject: Re: [Jprogramming] Expression to generate sequ
Ligh
How do I implement this sliding window verb 'f'? Where is this kind of
function described in the J documentation? Search keywords?
2 f 3 5 6 3 8 5 3 7
3 5
5 6
6 3
3 8
5 3
3 7
3 f 3 5 6 3 8 5 3 7
3 5 6
5 6 3
6 3 8
3 8 5
8 5 3
5 3 7
Skip
Skip Cave
It's called "infix".
3 <\ 'abcdefg'
┌───┬───┬───┬───┬───┐
│abc│bcd│cde│def│efg│
└───┴───┴───┴───┴───┘
3 <\ 7 5 $ 'the notorious lonesome stranger'
┌─┬─┬─┬─┬─┐
│the n│otori│ous l│oneso│me st│
│otori│ous l│oneso│me st│range│
│ous l│oneso│me st│range│rthe │
└─┴─┴
Change 2 < to , to get your exact result.
On Sat, Apr 7, 2018, 10:03 AM Roger Hui wrote:
> It's called "infix".
>
>3 <\ 'abcdefg'
> ┌───┬───┬───┬───┬───┐
> │abc│bcd│cde│def│efg│
> └───┴───┴───┴───┴───┘
>3 <\ 7 5 $ 'the notorious lonesome stranger'
> ┌─┬─┬─┬─┬─┐
> │the
f=: ]\
or
f=: ,\
or
f=: +\
I imagine...
--
Raul
On Sat, Apr 7, 2018 at 12:03 PM, Roger Hui wrote:
> It's called "infix".
>
>3 <\ 'abcdefg'
> ┌───┬───┬───┬───┬───┐
> │abc│bcd│cde│def│efg│
> └───┴───┴───┴───┴───┘
>3 <\ 7 5 $ 'the notorious lonesome stranger'
> ┌─┬─┬
J's facilities for this kind of thing are described at
http://code.jsoftware.com/wiki/Vocabulary/Loopless
Henry Rich
On 4/7/2018 11:57 AM, Skip Cave wrote:
How do I implement this sliding window verb 'f'? Where is this kind of
function described in the J documentation? Search keywords?
2 f 3
Ah, yes "infix". Thanks Roger. I knew it had to be something using "\" ,
but I couldn't remember how to do it, or what it was called.
Skip
Skip Cave
Cave Consulting LLC
On Sat, Apr 7, 2018 at 11:03 AM, Roger Hui
wrote:
> It's called "infix".
>
>3 <\ 'abcdefg'
> ┌───┬───┬───┬───┬───┐
> │ab
Henry,
The "Loopless" page is great! I have somehow overlooked that page on the
Jsoftware.com site. It helps a lot in understanding the various
repeated-operation primitives.
Skip
Skip Cave
Cave Consulting LLC
On Sat, Apr 7, 2018 at 11:39 AM, Henry Rich wrote:
> J's facilities for this kind
Thanks to everyone who answered - there were a few that were just what I
needed.
On Sat, Apr 7, 2018 at 6:48 AM, 'Pascal Jasmin' via Programming <
programm...@jsoftware.com> wrote:
> there is also,
>
> iota =: i. : (+ i.)
>
>
> 3 iota 5
> 3 4 5 6 7
>
> ([ iota >:@-~)/ 3 7
> 3 4 5 6 7
>
> 3 io