Greetings! Raymond Toy <[EMAIL PROTECTED]> writes:
> >>>>> "Camm" == Camm Maguire <[EMAIL PROTECTED]> writes: > > Camm> Well, certain compiler optimizations are keyed to the 'array symbol. > Camm> For example, all typing. subtypep cannot deal with `(maxima::array > Camm> fixnum *), it appears as an unknown type. > > If maxima code does that and it's really a Lisp array, the code is > probably wrong and should read cl:array instead. We should fix > these. > OK, I can provide some eg. if helpful. > >> > 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? > >> > > Camm> My apologies, I meant: > > Camm> (defmacro arraycall (ign array &rest dims) ign > Camm> `(aref (the (lisp::array ,ign) ,array) . ,dims)) > > Camm> This seems to work here, but I've got other bugs which may obscure > Camm> things in my current testing. > > This would make it significantly worse for cmucl and sbcl because the > declaration is saying it's an array of unknown dimensions. You might > want to do > > (aref (the (lisp::array ,ign ,(length dims)) ,array) . ,dims)), > This would be ok too. > but that could still hurt cmucl/sbcl if the compiler actually knew the > type of ,array before hand. Say, for example that the array was > actually a 1D simple-array of double-floats, with a known length. > Well, then the code should be in error (i.e. the arraycall invocation), no? GCL doesn't need this necessarily either when the array is a lexical produced by make-array or the like, but there are several special variables with array bindings which are not declaimed: e.g. factor.lisp: (declare-top(special afixn fctcfixn invcfixn)) Take care, > Ray > > > > -- Camm Maguire [EMAIL PROTECTED] ========================================================================== "The earth is but one country, and mankind its citizens." -- Baha'u'llah _______________________________________________ Gcl-devel mailing list [email protected] http://lists.gnu.org/mailman/listinfo/gcl-devel
