[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] Re: [Maxima] array questions

From: Camm Maguire
Subject: [Gcl-devel] Re: [Maxima] array questions
Date: 29 Mar 2006 17:34:21 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings, and thanks!

Raymond Toy <address@hidden> writes:

> >>>>> "Camm" == Camm Maguire <address@hidden> 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                                            address@hidden
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]