The values for the entire table can be easily generated in J but lack the
formatting of putting in the X and = to make it look exactly like the
output from Ruby. Many times people are more concerned on what the output
looks like and less about the thought behind it.

   ,.(2+i.4)(,,*)"0/(1+i.9)
2 1 2 2 2  4 2 3  6 2 4  8 2 5 10 2 6 12 2 7 14 2 8 16 2 9 18
3 1 3 3 2  6 3 3  9 3 4 12 3 5 15 3 6 18 3 7 21 3 8 24 3 9 27
4 1 4 4 2  8 4 3 12 4 4 16 4 5 20 4 6 24 4 7 28 4 8 32 4 9 36
5 1 5 5 2 10 5 3 15 5 4 20 5 5 25 5 6 30 5 7 35 5 8 40 5 9 45



On Sun, Apr 27, 2014 at 11:22 PM, Raul Miller <[email protected]> wrote:

> I meant homogeneous at the top level.
>
> That's probably not what you meant, of course. What you meant (a pervasive
> form of homogeneous) would probably be best represented by paring a flat
> array with an external representation of structure?
>
> Thanks,
>
> --
> Raul
>
>
> On Mon, Apr 28, 2014 at 1:06 AM, greg heil <[email protected]> wrote:
>
> > >Wow great! Now i suppose for the next few weeks i will use try the
> appose
> > hammer on every problem i encounter (it is mostly directory structures
> that
> > are popping nails now)
> >
> > >i do wonder though what you mean by homogeneous when it is perfectly
> > normal to have a boxed structure such as
> >
> > 'asf';1 2 3;(i.2 3);2.3 4.5;1 0 1 1
> >
> > Yes the external view is, but internal is anything but. So operators
> > can make NO assumptions which might be useful for simplification. Open
> > (and yours!) help though.
> >
> > greg
> > ~krsnadas.org
> >
> > --
> >
> > from: Raul Miller <[email protected]>
> > to: Programming forum <[email protected]>
> > date: 27 April 2014 20:46
> > subject: Re: [Jprogramming] [Jchat] How a Genius Programmer Rewirtes a
> > Ten-line code into One-line.
> >
> > Boxes are a homogeneous, ragged type.
> >
> > Also, something to think about:
> >
> >    open=: &:>
> >
> > Thanks,
> >
> > --
> >
> > from: greg heil <[email protected]>
> > to: Programming forum <[email protected]>
> > date: 27 April 2014 20:28
> > subject: Re: [Jchat] How a Genius Programmer Rewirtes a Ten-line code
> > into One-line.
> >
> > >i kind of liked Rogers idea but missed the decoration afforded by
> > textbook tables. This kept it to just the snippet afforded by the genius:
> >
> > * table open/ 1 2+ each i. each 9 4
> >
> > >it is a bit annoying that J treats boxes in such a cumbersome manner, so
> > i did have to define open:
> >
> > open=:1 : '([:>[) x [:>]'
> >
> > table and each are in the standard lib
> >
> > >i kind of miss the each`s (and the lack of boxes) of K -ragged data is
> so
> > easily dealt with (eg dictionaries, XML, json...). i do wonder if a
> subset
> > of J could be made where all the content of boxes were made of a
> homogenous
> > type, just ragged...
> >
> > greg
> > ~krsnadas.org
> >
> > --
> >
> > from: Roger Hui <[email protected]>
> > to: Chat Forum <[email protected]>
> > date: 27 April 2014 15:29
> > subject: Re: [Jchat] How a Genius Programmer Rewirtes a Ten-line code
> > into One-line.
> >
> > Yes, */~i.10.  And then +/~i.10, >./~i.10, <./~i.10, |/~i.10, +./~i.10,
> > etc.
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to