Fix bug #1581: sublis & sublis_apply_lambda:true causing lisp errors
The original case from the bug report:
sublis ([f = lambda ([[x]], 'g)], f [2] (x)) => lisp error
A similar but simpler case that I found:
sublis ([f = lambda ([], 'g)], f () ()) => lisp error
SIMPMQAPPLY was assuming the CAAR of an expression was a symbol
when it need not be. Having a Maxima lambda expression in the
CAAR can occur when sublis substitutes a lambda expression and
sublis_apply_lambda is true.
The only change in this commit is a symbol check before calling
GET in SIMPMQAPPLY. There is a special case in SIMPLIFYA for
lambda expressions in CAARs that performs the actual application.
Other functions like subst also use this special case for similar
effects.
See also the mailing list thread
"subst(lambda ...), was: multiple evaluations & integrate"
started on 2013-06-12 for a discussion on substitutions,
sublis_apply_lambda and non-symbols in CAARs.
The test suite runs fine.