[Maxima] "guarded" fetch from hashed array

Jaime Villate villate at fe.up.pt
Tue Feb 7 11:52:49 CST 2012

On 02/07/2012 04:38 PM, Edd Barrett wrote:
> I wish to use a hash table to store a mapping from a variable name to a
> list of coefficients. This is accomplished easily enough in maxima,
> however, is there a way of throwing an error if the key accessed is not
> a key in the hash table?
Have you tried with atom?

(%i2) hash[a]: "aaa"$
(%i3) atom(hash[a]);
(%o3) true
(%i4) atom(hash[b]);
(%o4) false


More information about the Maxima mailing list