|
From: Stavros M. <mac...@gm...> - 2025-11-14 12:39:32
|
*arrayinfo* But that's pretty ugly. We should really have an easy way of iterating over a hasharray. On Fri, Nov 14, 2025, 02:22 Eduardo Ochs <edu...@gm...> wrote: > 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 > > _______________________________________________ > Maxima-discuss mailing list > Max...@li... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > |