Hmm, searching my old IPSharp memories, I recalled that J does implement a named, potentially hierarchical data structure known as packages. Packages can be used to organize data as lists of name:value pairs, where the values could be deeper levels of packages.

It is a tad clumsier than a a true tree structured data type, but it may do what you need.

See pack.ijs for more information.

Cheers,
David Mitchell

On 2/1/2013 23:46, David Porter wrote:
Yes, I think that solving it in J style is probably better all the way around.
Though I will mourn the loss of the hierarchical data structure.  It was quite
useful.

Thanks,
Dave


On 2/1/2013 11:11 PM, chris burke wrote:
I suggest not trying to replicate the matlab structure in J, not least
since we don't have the concept of name1.name2.name3... levels.

Instead look at the problem to be solved and see how best that would be
done in J.

On Sat, Feb 2, 2013 at 11:49 AM, David Porter <[email protected]> wrote:

Thanks Raul.  That did help a little.

What has me now is how to get the following:
q1.tests.test1
q1.tests.test2
  q1.tests.test3

Under each of the three tests there will be multiple named variables.  If
I understand what coinsert does correctly, that is to put a new locale on
the search path before _z_, then I don't understand how you generate the
tree structure described above.

Then, again, maybe I am missing something that should be obvious...

Dave

On 2/1/2013 9:09 PM, Raul Miller wrote:

locales will do, but there's different ways of assigning depending on
what you mean by "assign".  For constants this is probably sufficient:

cocurrent 'q1'
    test=: 3.1415

cocurrent 'q2'
    coinsert 'q1'

cocurrent 'base'

     test_q1_
3.1415
     test_q2_
3.1415


------------------------------**------------------------------**----------
For information about J forums see
http://www.jsoftware.com/**forums.htm<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

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to