1. see Raul's response
2. Yes, I am bothered, a little. When you have something like a symbol
table or a position table in a game solver, where you have to do lots of
individual insertions and lookups, you might have to write a hashing
object. That has come up often enough for us to have put an
associative-list type on the wishlist of enhancements, but it has never
been high enough to get implemented.
If you have a table t that doesn't change much, and you want fast
lookups into it, use
index_in_t =: t&i.
when t&i. is executed, it computes a hashtable for t and saves it as
part of the derived verb. For more, see
http://code.jsoftware.com/wiki/Vocabulary/SpecialCombinations#Searching_and_Matching_Items:_Precomputed_searches
Henry Rich
On 12/3/2017 12:40 PM, Andrew Dabrowski wrote:
1. What's the idiomatic way to delete an item from a list? This
doesn't seem to come up in Learning J. For that matter, what's a good
reference for list slicing ops in J?
2. Is anyone bothered by the lack of a built-in associative list
structure? There are at least two different implementations in
Rosetta Code, but one is very bare-bones and the other uses classes,
which I'd prefer to avoid (I confess to having a bias against OO). I
guess J people have found other substitutes for
dicts/hashes/maps/associative arrays.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
---
This email has been checked for viruses by AVG.
http://www.avg.com
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm