arc> (= x (table))
#hash()
arc> (= (aref x 1 2) 3)
3
arc> x
#hash(((1 2 . nil) . 3))
arc> (x '(1 2))
3
However, strangely, my definition of aref, as:
(def aref (x . indices)
(x indices))
does not work as intended. If x, a table, has a value for the key (list 1 2), then (aref x 1 2) will not find that value. I investigated and, basically, it seems that the list created by (list 1 2) is nil-terminated, while the list constructed from a rest parameter is ()-terminated:
I imagine that's why the hash-table doesn't recognize the 'indices rest parameter as the key (1 2 . nil). Oh well, here's a stupid hack that makes 'aref work properly by constructing an Arc nil-terminated list: