Why does 'matrix' evaluate its arguments anomalously?



On 11/11/11, Stavros Macrakis <macrakis at alum.mit.edu> wrote:

> Can anyone think of a reason that matrix shouldn't be simply this:
>
> (defmfun $matrix (&rest rows)

OK, I remember now why matrix isn't an ordinary function.
GCL has a limitation of 64 arguments for a function, so attempting
to define a matrix with > 64 rows triggers an error.
That bug was noticed and a work around put in place; see commit message below.
If there is a better way to handle the situation, while still keeping it
workable for GCL, I'd be interested to hear about it.

best

Robert Dodier

PS.
commit 9bcad16b9eedcb8725197313808bc88fe1ce6b88
Author: robert_dodier <robert_dodier>
Date:   Thu Oct 12 15:18:45 2006 +0000

    (1) Work around GCL number of arguments limitation in $matrix.
    src/mlisp.lisp: change $matrix from defun to defmspec, and
evaluate arguments within $matrix.
      From point of view of caller, $matrix should work same as before
(but without bug).
    tests/rtest2.mac: new test cases for matrix function.

    (2) Avoid unintended upper/lower case inversion in declare(foo,
alphabetic) (in src/mlisp.lisp).
      Also process all characters in a string instead of just one at a time.