|
From: Eduardo O. <edu...@gm...> - 2025-11-14 07:21:51
|
Hi list,
how do I get the keys of a hash table in Maxima?
Or, more concretely, if we run this,
myhash : make_array(hashed);
myhash[42] : 420;
myhash[ab] : "abab";
myhash[42]; /* 420 */
myhash[ab]; /* "abab" */
myhash[cd]; /* false */
to_lisp();
(loop for k being the hash-keys in #$myhash$
collect k)
(loop for k being the hash-keys in #$myhash$
if (not (eq k 'dim1))
collect k)
(to-maxima)
The first LOOP returns (DIM1 42 $AB) and the second one
returns (42 $AB)... but is there a standard way to get
something like the result of the second loop without using
Lisp?
Some links:
(info "(maxima)make_array")
https://maxima.sourceforge.io/docs/manual/Data-Types-and-Structures.html#index-make_005farray
https://sourceforge.net/p/maxima/code/ci/master/tree/src/ar.lisp
Thanks in advance!
Eduardo Ochs
https://anggtwu.net/eev-maxima.html
|