Maxima interface for CL hash tables



Thanks for the info; I'm not sure how all this works (or doesn't work):

(%i1) a[1] : 42$
(%i2) :lisp(trace hash-table-p);

(%i2) listarray(a);
  1> (HASH-TABLE-P $A)
  <1 (HASH-TABLE-P NIL)
(%o2) [42]

(%i3) use_fast_arrays : true$
(%i4) b[1] : 42$
  1> (HASH-TABLE-P #<hash-table 1037d78c>)
  <1 (HASH-TABLE-P T)


I think this bug has been reported (I'll check)

(%i5) listarray(b);
  1> (HASH-TABLE-P $TRUE)
  <1 (HASH-TABLE-P NIL)
(%o5) [true,42]

Barton

maxima-bounces at math.utexas.edu wrote on 02/20/2009 10:16:06 AM:

> [image removed] 
> 
> Re: [Maxima] Maxima interface for CL hash tables
> 
> Robert Dodier 
> 
> to:
> 
> Barton Willis
> 
> 02/20/2009 10:16 AM
> 
> Sent by:
> 
> maxima-bounces at math.utexas.edu
> 
> Cc:
> 
> maxima
> 
> On Fri, Feb 20, 2009 at 7:44 AM, Barton Willis <willisb at unk.edu> wrote:
> 
> > I'm not going to puzzle my way though this, but the function listarray
> > (defined in  marray.lisp) has a clause
> >
> >   ((hash-table-p ary)
> >               (let (vals (tab ary))
> >                       ....
> > I'm not convinced that there is a Maxima interface to CL hash tables:
> 
> use_fast_arrays=true causes Maxima to create CL hash tables
> (and they are stuck in the value slot instead of in the property list).
> 
> If I m not mistaken, when use_fast_arrays=false, Maxima uses its
> own scheme for building a hash table. It seems we could replace
> that without any changes from the user's point of view.
> 
> There is also the question of whether hash tables should be values
> or something else. This is an aspect of the Lisp-1 vs Lisp-2 question.
> I think about this every now and then, but I haven't settled on one
> or the other.
> 
> The documentation for use_fast_arrays is pretty much incomprehensible;
> that's a bug. I think I could revise it, now that I understand (I 
think).
> 
> best
> 
> Robert
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima