An example of using packages:

   load'pack'
   r1=:'res text'
   r2=:2 3 4
   r3=: i. 5 6
   test1=: pack'r1 r2 r3'
   r1=:'scraps'
   r2=:_1
   r3=: 'fizzy'
   test2=: pack'r1 r2 r3'
   r1=:_10+ i. 5
   r2=:'pils'
   r3=: 600 1$'o'
   test3=: pack'r1 r2 r3'
   q1_tests=:pack'test1 test2 test3'
   #q1_tests
3
   'r1' pget 'test1' pget q1_tests
res text
   'r1' pget 'test2' pget q1_tests
scraps
   'r1' pget 'test3' pget q1_tests
_10 _9 _8 _7 _6


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

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

Reply via email to