[Jprogramming] Something almost like i.
Raul Miller
rauldmiller at gmail.com
Thu Mar 1 02:16:14 HKT 2007
On 2/28/07, Roger Hui <rhui000 at shaw.ca> wrote:
> This sounds like the "spread" or "n-up" verb
> that was discussed recently under "Style and
> Literacy in APL".
It's analogous, but up is simpler:
It would generate:
0 6 12
1 7 13
2 8 14
3 9 15
4 10
5 11
instead of
0 6 11
1 7 12
2 8 13
3 9 14
4 10 15
5
Oleg's approach seems like it will work, though I've
simplified it a bit, eliminating some unnecessary
operations and taking advantage of the fact that I
don't care if extra bogus entries appear after the end
of the list:
mv2=: [: ,@|:@($ ($ <:) [: +/\ ,)@|: [ > >.@% i.@, ]
And, yeah, I'm checking to see if I can get rid of
the requirement that padding be spread across
as many columns as possible.
Thanks,
--
Raul
>
> http://www.jsoftware.com/pipermail/programming/2007-February/005240.html
>
>
>
> ----- Original Message -----
> From: Raul Miller <rauldmiller at gmail.com>
> Date: Wednesday, February 28, 2007 9:21 am
> Subject: Re: [Jprogramming] Something almost like i.
>
> > On 2/28/07, Devon McCormick <devonmcc at gmail.com> wrote:
> > > Maybe I need more coffee, but I'm not clear on what you're
> > trying to do
> > > here.
> >
> > I'm trying to arrange things in columns, visually.
> >
> > Physically, I'm arranging them left-to-right, top-to-bottom.
> >
> > However, I want the columns to appear to be arranged
> > vertically.
> >
> > This is trivial when the total number of items matches divides
> > evenly, but is a bit more complex when they don't (and I
> > need the initial columns to be longer).
> >
> > Ultimately, since the data about what each of these things
> > is split across several arrays, I think what I really want is
> > the indices into those original arrays. Thus, I wind up wanting
> > indices arranged like:
> >
> > 0 6 11
> > 1 7 12
> > 2 8 13
> > 3 9 14
> > 4 10 15
> > 5
> >
> > I don't really care what's in the two positions I left blank,
> > because I'll never be referencing those indices.
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
More information about the Programming
mailing list