apply('matrix,'[[print(3)]]) prints 3 -- that is, it evaluates its argument twice. This is a bug that causes problems in, e.g., mat_function. See http://comments.gmane.org/gmane.comp.mathematics.maxima.general/43716
The fix is to redefine $matrix as a regular function (not a defmspec):
(remprop '$matrix 'mfexpr*)
(defun $matrix (&rest rows)
(dolist (row rows)
(if (not ($listp row)) (merror (intl:gettext "matrix: row must be a list; found: ~M") row)))
(matcheck rows)
(cons '($matrix) rows))
I have NOT run the test suite after adding this fix.
Diff:
Fixed by commit 31c58ed22 (rework $MATRIX in a slightly different way than shown here).