Some kind of generalized maps, suitable for generalized arrays :) /Erling
On 2017-12-04 13:41, 'Bo Jacoby' via Programming wrote:
Erling Hellenäs is playing with the idea of tying labels to the noun. The noun could have a label, labels could be tied to rows and columns. Addressing and indexing could then optionally be done with those labels. For your information, using ordinal fractions this is done like this. 00 noun 10 first row 20 second row 01 first column 02 second column 11 array element 12 array element 21 array element 22 array element Note that the digit value zero (0) is wild card character rather than index. /Bo. Den 12:33 mandag den 4. december 2017 skrev Raul Miller <[email protected]>:Ok, so https://en.wikipedia.org/wiki/Associative_array rather than https://en.wikipedia.org/wiki/Association_list? For this, I think I'd use a pair of lists - one of keys, one of values. Possibly I'd stick them in a pair of boxes so I could pretend to be using a purely functional parameter system. But given the emphasis on mutability here, I think I'd prefer to refer to them by name. I'll think about this a bit and probably add a note to the referenced rosettacode entry. If I were adding a type to J, I'd probably want to borrow K's table type (probably including deep ties to the assignment operations and the part where you can transpose them to get a different representation, though I'm not sure that |: would be the way to achieve that kind of transpose). Thanks,
---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
