Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-11 Thread Dan Bron
David Lambert wrote: > I wrote the rosetta code red-black tree entry. I haven't read/reviewed the Red-Black tree implementation on RosettaCode, but it did remind me of an argument I once made for supplying I. with an inverse [1]: > I.-space is useful, particularly when the domain (input & ou

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-11 Thread David Lambert
I wrote the rosetta code red-black tree entry. As Devon guessed, I followed Robert Sedgewick's left leaning red-black tree paper. As the notes page indicates, merely giving an example of symbols relies on implementation detail. I'll post such an entry if there's an agreement. 1r3 of the cod

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-11 Thread 'Bo Jacoby' via Programming
Wed, Sep 10, 2014 at 10:44 AM, Dan Bron wrote: > >> I would be interested to see a model of >> arrays-and-trees-as-ordinal-fractions in J. With such things as indexing, >> catenation, etc. >> >> -Dan >> >> - Original Message --- >> >&

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-10 Thread Thomas Costigliola
th such things as indexing, > catenation, etc. > > -Dan > > - Original Message ------- > > Subject: Re: [Jprogramming] Ragged Array Shapes are Trees >From: "'Bo Jacoby' via Programming" >Date: Tue, 9 Sep 2014 12:41:14 +0100 > To:

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-10 Thread Dan Bron
I would be interested to see a model of arrays-and-trees-as-ordinal-fractions in J. With such things as indexing, catenation, etc. -Dan - Original Message --- Subject: Re: [Jprogramming] Ragged Array Shapes are Trees From: "'Bo Jacoby' via Programming"

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-09 Thread 'Bo Jacoby' via Programming
ifference here). >>> >>> Linda >>> >>> -Original Message- >>> From: programming-boun...@forums.jsoftware.com [mailto: >>> programming-boun...@forums.jsoftware.com] On Behalf Of Michal D. >>> Sent: Tuesday, Sept

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-09 Thread Raul Miller
>> >> Linda >> >> -Original Message- >> From: programming-boun...@forums.jsoftware.com [mailto: >> programming-boun...@forums.jsoftware.com] On Behalf Of Michal D. >> Sent: Tuesday, September 09, 2014 1:14 AM >> To: programm...@jsoftwa

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-09 Thread Michal D.
eptember 09, 2014 1:14 AM > To: programm...@jsoftware.com > Subject: Re: [Jprogramming] Ragged Array Shapes are Trees > > One can imagine that it's possible for > >] x =. (<@i."0) 1+i.3 > +-+---+-+ > |0|0 1|0 1 2| > +-+---+-+ > > to be laid out in m

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-09 Thread Raul Miller
On Tue, Sep 9, 2014 at 6:45 PM, David Leibs wrote: > I just think the Array Theory body work is worth looking at and > understanding as it is a very interesting bit of the history of APL. > "Nested Array Theory" gives you nested arrays without any need for boxing > or unboxing. That's sort of lik

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-09 Thread David Leibs
Raul Miller wrote: >Anything which puts infinity n the "must use routinely" path is going to cause >schisms. >There's an infinity of ways of dealing with infinities, and people can only do >so much. > >Then again, some people like schisms. > >They are probably best left alone (as much as they will

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-09 Thread 'Pascal Jasmin' via Programming
r arrays). In other words: this (seamless integration of trees in J) is a worthy objective, but not an easy one to achieve. Personally, I'd be happy to contribute to such an initiative, but I lack the self-confidence to lead it. -Dan - Original Message ------- Subject: Re: [J

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-09 Thread Raul Miller
On Tue, Sep 9, 2014 at 1:50 PM, David Leibs wrote: > This influenced APL2. Some say that this caused "a schism" in the APL > community. Anything which puts infinity n the "must use routinely" path is going to cause schisms. There's an infinity of ways of dealing with infinities, and people can o

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-09 Thread David Leibs
Trenchard More worked on a theory of nested arrays for a long time. For those interested you should google Trenchard More and Array Theory. Trenchard More worked with Mike Jenkins for a long time on a language called Nial http://www.nial.com/ArrayTheory.html You can think of Trenchard More's wo

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-09 Thread Devon McCormick
r of invoices, but can't naively use L: because > a customer might also have nested phone numbers or other data. The point > of this blabbering is that sometimes # is domain specific. > > > > > - Original Message - > From: Dan Bron > To: programm...@jsoftware.com > Cc: >

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-09 Thread Thomas Costigliola
nitions as they apply to rectilinear arrays). > > In other words: this (seamless integration of trees in J) is a worthy > objective, but not an easy one to achieve. Personally, I'd be happy to > contribute to such an initiative, but I lack the self-confidence to lead > it. > >

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-09 Thread Dan Bron
seamless integration of trees in J) is a worthy objective, but not an easy one to achieve. Personally, I'd be happy to contribute to such an initiative, but I lack the self-confidence to lead it. -Dan - Original Message ------- Subject: Re: [Jprogramming] Ragged Array Shapes are Tr

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-09 Thread Dan Bron
Michael was speaking in the context of a hypothetical, extended version of J. His comments needn't be applied to our current, actual language. - Original Message --- Subject: Re: [Jprogramming] Ragged Array Shapes are Trees From: "Linda Alvord" Date: Tue,

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-09 Thread Linda Alvord
mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Michal D. Sent: Tuesday, September 09, 2014 1:14 AM To: programm...@jsoftware.com Subject: Re: [Jprogramming] Ragged Array Shapes are Trees One can imagine that it's possible for ] x =. (<@i."0) 1+i.3 +-+---+-+ |0|0 1|0 1 2| +-+---

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-09 Thread 'Pascal Jasmin' via Programming
agged Array Shapes are Trees Here's a question to chew on. What's the # of a tree? - Original Message --- Subject: Re: [Jprogramming] Ragged Array Shapes are Trees From: "Michal D." Date: Mon, 8 Sep 2014 23:04:34 -0700 To: programm...@jsoftware.

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-09 Thread Devon McCormick
problem in J and > attempted to solve it. Has anyone read the paper? Does anyone have a public > version of the article to share? > > > > [2] Though the Wiki article above links to it, it's worth calling out > > specifically Devon's summary of "A Programming Lanaugage&q

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-09 Thread Thomas Costigliola
of the article to share? > [2] Though the Wiki article above links to it, it's worth calling out > specifically Devon's summary of "A Programming Lanaugage"'s proposal for > trees. > http://www.jsoftware.com/jwiki/DevonMcCormick/APLTree > > > --

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-09 Thread Dan Bron
Linda wrote: > Things are not always as they seem! > > ]x=:?5#10 > 9 8 5 7 4 > > +/"1 x > 33 > +/x > 33 > > +/&.>x > +-+ > ¦9¦8¦5¦7¦4¦ > +-+ What are you trying to say here? -Dan

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-09 Thread Linda Alvord
Of Michal D. Sent: Tuesday, September 09, 2014 1:14 AM To: programm...@jsoftware.com Subject: Re: [Jprogramming] Ragged Array Shapes are Trees One can imagine that it's possible for ] x =. (<@i."0) 1+i.3 +-+---+-+ |0|0 1|0 1 2| +-+---+-+ to be laid out in memory as [0 0 1

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-09 Thread Dan Bron
Here's a question to chew on. What's the # of a tree? - Original Message --- Subject: Re: [Jprogramming] Ragged Array Shapes are Trees From: "Michal D." Date: Mon, 8 Sep 2014 23:04:34 -0700 To: programm...@jsoftware.com Thanks for the

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-09 Thread 'Bo Jacoby' via Programming
gt;>> > | |+-+---+| >>> > +-+---+ >>> > >>> > There's no specific problem I'm trying to solve directly in J at the >>> > moment. It's more of a language design problem. My interest in this is >>> a >>> > J like

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-09 Thread Raul Miller
t; boxing. Failing that, we could have some optimization guarantees like >> 'an >> > array of boxes containing equal rank values are allocated contiguously'. >> > >> > Cheers, >> > >> > Mike >> > >> > >> > >> > On Sat, Sep 6, 2014 at 9:28 AM, 'Pascal Jasmin&#x

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-08 Thread Michal D.
┘ > > while it seems complicated, each use of "each" creates an open after > selecting from right to left. It provides a way to update trees with a verb > > > > - Original Message - > From: Dan Bron > To: programm...@jsoftware.com &g

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-08 Thread Michal D.
e-in-cheek, though I do believe "redesign the language" makes > "improve the performance of trees" seem easy by comparison.) > > > > - Original Message --- > > Subject: Re: [Jprogramming] Ragged Array Shapes are Trees >From: Raul Mil

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-08 Thread Michal D.
.@jsoftware.com> wrote: > > > >> Hi Michal, > >> > >> maybe this is an interesting representation for what you want? > >> > >>([:|. $ ;~ $ each) (i. 2 3) ; (,0) ; 0 1 > >> ┌─┬─┐ > >> │3│┌───┬─┬─┐│ > >> │ ││2 3│1│2

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-08 Thread Devon McCormick
awesome, Thomas. For those who didn't load the code, its > much easier to use than it looks as everything is a verb, and the whole > thing is like a mini stack language, and each operation produces intuitive > and visible results. > > > > > > > > > >- Origina

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-08 Thread Linda Alvord
That's it! Thanks. Linda -Original Message- From: programming-boun...@forums.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Raul Miller Sent: Monday, September 08, 2014 9:03 PM To: Programming forum Subject: Re: [Jprogramming] Ragged Array Shapes are

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-08 Thread Raul Miller
> From: programming-boun...@forums.jsoftware.com > [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Michal D. > Sent: Monday, September 08, 2014 11:01 AM > To: programm...@jsoftware.com > Subject: Re: [Jprogramming] Ragged Array Shapes are Trees > > Thanks P

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-08 Thread Raul Miller
Point taken. But neither you nor I (for example) have bothered to be interested enough in Red Black trees to implement anything better. And for a problem that size, it's really not right to put an hour into criticizing it when an hour could have been used to show what you mean using an actual impl

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-08 Thread Linda Alvord
oftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Michal D. Sent: Monday, September 08, 2014 11:01 AM To: programm...@jsoftware.com Subject: Re: [Jprogramming] Ragged Array Shapes are Trees Thanks Pascal, that's a nice formulation for the 2-level deep case. It

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-08 Thread Dan Bron
Yes, but to Devon's point, having a direct transliteration of an algorithm originally expressed in a (very) different language doesn't tell us anything about J's power (or not) to express that algorithm. Any programming language worth discussing is Turing complete. Which means they're all *capa

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-08 Thread Raul Miller
It is, nevertheless, an implementation. And anyone that feels like doing so can supply other alternates (or replace it, if they feel theirs is good enough). Thanks, -- Raul On Mon, Sep 8, 2014 at 5:28 PM, Devon McCormick wrote: > This looks like a transliteration from another language - not

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-08 Thread 'Bo Jacoby' via Programming
>easier to use than it looks as everything is a verb, and the whole thing is >like a mini stack language, and each operation produces intuitive and visible >results. > > > > >- Original Message - >From: Thomas Costigliola >To: J Programming Forum >Cc: &g

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-08 Thread Devon McCormick
This looks like a transliteration from another language - not J-like at all. Once clue is that it's several times as long as many of the other implementations. On Mon, Sep 8, 2014 at 4:05 PM, Joe Bogner wrote: > I found an implementation of red-black trees on rosettacode: > http://rosettacode.

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-08 Thread 'Pascal Jasmin' via Programming
homas Costigliola To: J Programming Forum Cc: Sent: Monday, September 8, 2014 4:04 PM Subject: Re: [Jprogramming] Ragged Array Shapes are Trees Array representations and "pointer" representations of trees both have their uses. In the end it depends on what problem you are trying to

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-08 Thread Joe Bogner
I found an implementation of red-black trees on rosettacode: http://rosettacode.org/wiki/Pattern_matching#J ... It might be relevant or may not be. On Mon, Sep 8, 2014 at 3:45 PM, Devon McCormick wrote: > A little research clarified what we see here: apparently it's part of the > definition of

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-08 Thread Thomas Costigliola
Array representations and "pointer" representations of trees both have their uses. In the end it depends on what problem you are trying to solve. As Devon demonstrated, for his purpose, array representation was not a hindrance at all. But, as Dan mentions, trees are also used to implement abstract

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-08 Thread Devon McCormick
A little research clarified what we see here: apparently it's part of the definition of a binary tree that the left node be smaller than its parent but the right one is greater. Right away, I see a problem for the predecessor-index representation of a tree that I'm advocating as it does not distin

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-08 Thread 'Pascal Jasmin' via Programming
l repeat that I agree that }:: (with compatible indexing to {::) would be a big improvement, though the above uses a fairly simple workaround. - Original Message - From: Dan Bron To: programm...@jsoftware.com Cc: Sent: Monday, September 8, 2014 2:30 PM Subject: Re: [Jprogramming] Ragge

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-08 Thread Devon McCormick
At a minimum, I hope we can be a tad more elegant than this: http://www-cs.ccny.cuny.edu/~peter/dstest/h_bl_tree.c . On Mon, Sep 8, 2014 at 3:03 PM, Devon McCormick wrote: > Do you have a reference to a good example of this? Looking at the > "before" and "after" pictures on the right here - >

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-08 Thread Devon McCormick
Do you have a reference to a good example of this? Looking at the "before" and "after" pictures on the right here - http://en.wikipedia.org/wiki/Self-balancing_binary_search_tree - the rebalancing seems arbitrary as it preserves some relations but changes others. On Mon, Sep 8, 2014 at 2:30 PM,

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-08 Thread Raul Miller
tus of J, but certainly not final; if we put our backs into it, >> we could get this done). >> >> -Dan >> >> [1] Old thoughts on the question of trees in J: >> http://www.jsoftware.com/jwiki/DanBron/Temp/Tree >> >> [2] Though the Wiki article ab

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-08 Thread Dan Bron
Raul wrote: > Note that J already supports trees. Devon wrote: > I have J code that uses trees which I run daily and > have been doing so for years. Pascal wrote: > I think trees are done at least ok, if not "right" already. Challenge: express, in J, the logic of rebalancing a heap (say, a Fi

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-08 Thread 'Pascal Jasmin' via Programming
von's summary of "A Programming Lanaugage"'s proposal for trees. http://www.jsoftware.com/jwiki/DevonMcCormick/APLTree - Original Message --- Subject: [Jprogramming] Ragged Array Shapes are Trees From: "Michal D." Date: Sat, 6 Sep 2014

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-08 Thread Dan Bron
S/SMOP.html (tongue-in-cheek, though I do believe "redesign the language" makes "improve the performance of trees" seem easy by comparison.) - Original Message ------- Subject: Re: [Jprogramming] Ragged Array Shapes are Trees From: Raul Miller Date: Mon,

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-08 Thread Devon McCormick
iki article above links to it, it's worth calling out > specifically Devon's summary of "A Programming Lanaugage"'s proposal for > trees. > http://www.jsoftware.com/jwiki/DevonMcCormick/APLTree > > > - Original Message --- > > Subj

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-08 Thread Raul Miller
e question of trees in J: > http://www.jsoftware.com/jwiki/DanBron/Temp/Tree > > [2] Though the Wiki article above links to it, it's worth calling out > specifically Devon's summary of "A Programming Lanaugage"'s proposal for > trees. > http://w

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-08 Thread Dan Bron
. http://www.jsoftware.com/jwiki/DevonMcCormick/APLTree ----- Original Message --- Subject: [Jprogramming] Ragged Array Shapes are Trees From: "Michal D." Date: Sat, 6 Sep 2014 09:06:38 -0700 To: programm...@jsoftware.com I just came to the realization that ragged array

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-08 Thread Raul Miller
; maybe this is an interesting representation for what you want? >> >>([:|. $ ;~ $ each) (i. 2 3) ; (,0) ; 0 1 >> ┌─┬─┐ >> │3│┌───┬─┬─┐│ >> │ ││2 3│1│2││ >> │ │└───┴─┴─┘│ >> └─┴─────────┘ >> >> >> >> - Original Messag

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-08 Thread Michal D.
([:|. $ ;~ $ each) (i. 2 3) ; (,0) ; 0 1 > ┌─┬─┐ > │3│┌───┬─┬─┐│ > │ ││2 3│1│2││ > │ │└───┴─┴─┘│ > └─┴─┘ > > > > - Original Message - > From: Michal D. > To: programm...@jsoftware.com > Cc: > Sent: Saturday, September 6, 2014 12:06 PM > Sub

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-06 Thread 'Bo Jacoby' via Programming
age - >From: Michal D. >To: programm...@jsoftware.com >Cc: >Sent: Saturday, September 6, 2014 12:06 PM >Subject: [Jprogramming] Ragged Array Shapes are Trees > >I just came to the realization that ragged array shapes, regardless of how >you want to represent them, are

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-06 Thread 'Pascal Jasmin' via Programming
, September 6, 2014 12:06 PM Subject: [Jprogramming] Ragged Array Shapes are Trees I just came to the realization that ragged array shapes, regardless of how you want to represent them, are trees. I would be interested in any references to prior exploration of this idea. Some example data (boxes are

Re: [Jprogramming] Ragged Array Shapes are Trees

2014-09-06 Thread Raul Miller
Trees are an abstraction. Conceptually speaking all arrays - even non-ragged - can be thought of as trees. Whether they are very flat trees (only one level deep) or very tall and skinny trees (only one child at each node) or whether they are something else is not pre-determined. And that's the pr

[Jprogramming] Ragged Array Shapes are Trees

2014-09-06 Thread Michal D.
I just came to the realization that ragged array shapes, regardless of how you want to represent them, are trees. I would be interested in any references to prior exploration of this idea. Some example data (boxes are used to display ragged arrays, but otherwise have no semantic meaning): ] A