Discussion:
[Bug-apl] Grouping function
Elias Mårtenson
2017-06-17 10:17:24 UTC
Permalink
I'm sure there was a function that could do this, but for the life of me
can't figure out which one it was.

Assuming I have an array of values, I want to split them into groups of N
numbers, which are overlapping. I.e. if the group size is 3 and the array
contains the values 1 2 3 4 5 6, I want the result to be:

(1 2 3) (2 3 4) (3 4 5) (4 5 6)

How do I do this?
Kacper Gutowski
2017-06-17 10:25:32 UTC
Permalink
Post by Elias MÃ¥rtenson
I'm sure there was a function that could do this, but for the life of me
can't figure out which one it was.
It was dyadic reduce operator:

3,/⍳6
1 2 3 2 3 4 3 4 5 4 5 6


-k
Elias Mårtenson
2017-06-17 10:28:02 UTC
Permalink
Thank you. That's what I needed.
Post by Elias MÃ¥rtenson
I'm sure there was a function that could do this, but for the life of me
can't figure out which one it was.
3,/⍳6
1 2 3 2 3 4 3 4 5 4 5 6
-k
Hans-Peter Sorge
2017-06-19 10:20:16 UTC
Permalink
Hi,

in files
trunk/README-9-post-installation

and
trunk/support-files/105-key-International-Keyboard/keyboard1.txt

"gnu.apl" should be named "gnu-apl".

fix:
cd $YOURPATH/trunk
sed -i s/gnu[.]apl/gnu-apl/ \
README-9-post-installation \
support-files/105-key-International-Keyboard/keyboard1.txt


Thank You,

Hans-Peter

Loading...