If I have a simple class such as:
coclass 'example'
create =: 3 : ' X =: y'
destroy =: codestroy
And I make a list of new objects:
n =.'example' (conew~)"(1 0) i.4
n
+-+-+-+-+
|4|5|6|7|
+-+-+-+-+
Then I can get at the X's inside each object like this:
X_4_
0
X_5_
1
And like this:
v =. <":5
X__v
1
But how can I reconstruct the values of the X's from the list n?
i.e., is there anything that looks like this?
(X__ <something>)"0 n
0 1 2 3
Presumably the code to call a method on each object would look the same?
I.e if there was a method: getX =: 3 : 'X'
then calling it would look like?
(getx__ <something>)"0 n
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm