> On Dec 3, 2017, at 10:40 AM, Andrew Dabrowski <[email protected]> wrote:
> 
> 2. Is anyone bothered by the lack of a built-in associative list structure?


There have been a few times so far that I have thought I needed this, but so 
far I have found another approach that works better. 

In one case, I instead just kept separate arrays for keys and values. I still 
think in a record-oriented way, but I think column-oriented suits J better; if 
the types are compatible, one array for keys and then a matrix of values. After 
all, if I do the calculation with one value, it will probably extrapolate 
nicely to the whole sequence of values and suddenly the whole calculation is 
done.

In another case I needed to use the key as an enum, to choose between different 
computations, but instead I turned the keys into integer values and applied a 
gerund.

These two approaches won't suffice for processing JSON, but so far it seems to 
be the case that where we have one thing in the past, J has three or four, and 
I've only seen two so far. It's similar going from assembly to structured 
programming though, where jumps turn into while/for/foreach/do-while.

-- 
Daniel Lyons




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

Reply via email to