access to $display from Lisp REPL?



On July 22, 2011, Barton Willis wrote:
****************************
Use mfuncall to call a defmspec function from CL 

(%i2) :lisp(mfuncall '$display 'x 'y 42)
x=x
y=y
42=42
$DONE
************************
Thanks for the suggestion.
Your method works for a lisp string but
not for a lisp list, as shown below:
---------------------------
Maxima 5.24.0 
using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL)

(%i1) display2d:false$
(%i2) to_lisp();
Type (to-maxima) to restart, ($quit) to quit Maxima.

MAXIMA> (setq s1 "My string")

"My string"
MAXIMA> (setq l1 '(1 2 3))

(1 2 3)
MAXIMA> (mfuncall '$display 's1)
?s1 = "My string"

$DONE
MAXIMA> (mfuncall '$display 'l1)

Maxima encountered a Lisp error:

 Error in EVAL [or a callee]: Caught fatal error [memory may be damaged]

Automatically continuing.
To reenable the Lisp debugger set *debugger-hook* to nil.

MAXIMA> 
------------------------------------
Ted