On 6/27/07, praimon <praimon at gmail.com> wrote:
> The challenge now is to come up with 'unusual' defining variable names
> while retaining the readability of the code.
FWIW here is a reimplementation of apply and outermap which
makes them evaluate their arguments in the same way as most
other built-in functions. You can put this stuff in a file and load
in at the Maxima input prompt. I find these new versions resolve
the problem you reported, without causing any new errors in the
Maxima test suite.
HTH
Robert Dodier
PS. Here is the code.
(remprop '$apply 'mfexpr*)
(defun $apply (fun arg)
(unless ($listp arg)
(merror "Attempt to apply ~:M to ~M~
~%Second argument to `apply' must be a list." fun arg))
(let ((fun-opr (getopr fun)))
(autoldchk fun-opr)
(mapply1 fun-opr (cdr arg) fun `(($apply) ,fun ,arg))))
(remprop '$outermap 'mfexpr*)
(defun $outermap (x y &rest z)
(if z
(apply #'outermap1 `(,x ,y , at z))
(fmapl1 x y)))