On Tue, Mar 23, 2010 at 1:14 PM, David Ward Lambert <[email protected]> wrote: > Thank you for sticking with me. We've uncovered inconsistencies. I > hope someone of authority is listening. In addition to what you pointed > out about fetch (copied below), is this: > > file:///usr/local/j64-602/help/dictionary/dscapco.htm , the dictionary > entry for spread says:
Before getting into this, I should note that I do not like using file:// urls, because they are not portable to other machines. For this case, I prefer http://www.jsoftware.com/help/dictionary/dscapco.htm > 11 {. t (; <@;) S: 0 1 {:: t NB. A 2-column table of leaves and > paths > > Allowing for the foreshortening by 11{. , is wrong in general because > razing changes the data '' -: ; ,^:4 a: is 1. But that was a specific example and not a general treatment. All 11 {. does, here, is cut the result down in size -- we are looking at the first 11 tokens of that definition instead of looking at all 20. In other words: fetch=: >@({&>/)@(<"0@|....@[ , <@]) " 1 _ t=: 5!:2 <'fetch' T20=: t (; <@;) S: 0 1 {:: t T11=: 11 {. t (; <@;) S: 0 1 {:: t tokens=: [: ; <"0&.>@{:@|:@] ":@{::L:1 _ [ t tokens T11 >@{&>/@<"0@ t tokens T20 >@{&>/@<"0@|....@[,<@]"1 _ > For example, these > structures differ in level but have the same 2-column table of leaves > and paths. ... Yes, razing the paths only allows us to reconstitute the original path if we know something about the ranks of the arrays in which the boxes are arranged. In the example, above, all boxes are arranged in lists, so reconstruction is easy. In the general case, with totally arbitrary boxing, it would be best to preserve the actual paths. That said, the value of a path is that it lets you index from a landscape of boxes. Currently, J does not give you a path when the shape of the boxes is empty. For example, consider the result of {:: 0#L:_1 'a';a:;9 and notice the absence of any paths that have a 1 in them. This might be an appropriate time to start posting empty array jokes? > The dictionary provides a model thus clearly states action---though > difficult. The dictionary {:: entry shows > t ,&< S: 0 1 {:: t > A 2-column table of > leaves and paths > which looks right to me in general. > > I favor an incompatible change to j that resolves the issue knowing full > well it is unpopular. Of course, my code investment is nil and it still > takes me three days to understand t (; <@;) S: 0 1 {:: t I am not sure what you are proposing here. Thanks, -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
