Newsgroups: comp.lang.apl
Path: watmath!watserv2.uwaterloo.ca!torn!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!newsserver.jvnc.net!howland.reston.ans.net!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!csus.edu!sfsuvax1.sfsu.edu!emclean
From: emclean@sfsuvax1.sfsu.edu (Emmett McLean)
Subject: Re: help with a j "split" function
Message-ID: <1993Feb21.015733.17808@csus.edu>
Keywords: J
Sender: news@csus.edu
Organization: San Francisco State University
References: <abalje47.730255144@ursa>
Date: Sun, 21 Feb 1993 01:57:33 GMT
Lines: 27

NB. Alan Baljeu writes:
NB. 
NB. >I'm trying to construct a function that will work like this:
NB. >
NB. >	0 1 2 1 0 0 1 split 1 2 3 4 5 6 7
NB. >+-------+-------+---+
NB. >| 1 5 6 | 2 4 7 | 3 |
NB. >+-------+-------+---+
NB. >
NB. >By the way, I'll probably use the function like:
NB. >	fivesplit =. (5: > right) split right
NB. >	fivesplit 2 4 7 3 76 
NB. >+-------+------+
NB. >| 2 4 3 | 7 76 |
NB. >+-------+------+
NB. 
NB.    
NB. NB. 0!:2 This, it should be what you want.
 
   right =. ]
   split =. </.
   fivesplit =. (5: > right) split right
   0 1 1 2 split 3 4 5 6
   0 1 2 1 0 0 1 split 1 2 3 4 5 6 7
   fivesplit 2 4 7 3 76 

    <'Emmett'
