array questions



Greetings, and thanks!

Raymond Toy <raymond.toy at ericsson.com> writes:

> >>>>> "Camm" == Camm Maguire <camm at enhanced.com> writes:
> 
>     Camm> Greetings!  In getting maxima working on gcl 2.7.0, I came across the
>     Camm> following strangeness:
> 
> 
>     MAXIMA> (eq 'array 'lisp::array)
>     Camm> NIL
> 
>     Camm> (defmacro arraycall (ign array &rest dims) ign
>     Camm> 	  `(aref ,array . ,dims))
> 
>     Camm> This slows down array referencing enormously, at least when compiled
>     Camm> with GCL, and I suspect others too.  What would be the matter with
>     Camm> importing 'array into 'maxima, and then
> 
> I fail to see how importing cl:array into maxima changes anything.
> 

Well, certain compiler optimizations are keyed to the 'array symbol.
For example, all typing.  subtypep cannot deal with `(maxima::array
fixnum *), it appears as an unknown type.

> 
>     Camm> (defmacro arraycall (ign array &rest dims) ign
>     Camm> 	  `(aref (the ,ign ,array) . ,dims))
> 
> A peek at some of the uses of arraycall shows that it's something like
> (arraycall flonum aarray index).  Won't your macro expansion produce
> (aref (the flonum aarray) index) which is totally wrong?
> 

My apologies, I meant:

(defmacro arraycall (ign array &rest dims) ign
	  `(aref (the (lisp::array ,ign) ,array) . ,dims))

This seems to work here, but I've got other bugs which may obscure
things in my current testing.

Take care,

> Ray
> 
> 
> 
> 
> 
> 

-- 
Camm Maguire			     			camm at enhanced.com
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah