evaluates its arguments and concatenates them into a string. Unlike CONCAT, the arguments do NOT need to be atoms. The result is a Common Lisp String.
(C5) sconcat("xx[",3,"]:",expand((x+y)^3)); (D5) xx[3]:Y^3+3*X*Y^2+3*X^2*Y+X^3
The resulting string could be used in conjunction with print.
(C1) DISPLAY(B[1,2]); 2 B = X - X 1, 2 (D1) DONE
User PART INPART a-b; A - B A + (- 1) B A - 1 a/b; - A B B 1/2 sqrt(x); SQRT(X) X 4 X 4 X*4/3; --- - X 3 3
(C1) ERROR("The function", FOO,"doesn't like", U,"as input."); prints as: The function FOO doesn't like ERREXP1 as input. If ERROR_SIZE>24 then as: E D C + B + A The function FOO doesn't like -------------- as input. COS(X - 1) + 1
Expressions larger than ERROR_SIZE are replaced by symbols, and the symbols are set to the expressions. The symbols are taken from the user-settable list
ERROR_SYMS:[ERREXP1,ERREXP2,ERREXP3]
. The default value of this switch might change depending on user experience. If you find the defaults either too big or two small for your tastes, send mail to MACSYMA.
(C4) load("eigen"); MACSYMA BUG: Unknown file type NIL Error: macsyma error Error signalled by MEVAL1. Broken at $LOAD. Type :H for Help. MAXIMA>>:q By examining the file system we find the file is actually in /public/maxima/share/eigen.mc. So we add that to the file_search path. This can be done at start up (see sys-init.lsp in the system directory or, else it can be done and then the system resaved once it has been customized for local directories and pathnames. At lisp level we would do (in-package "MAXIMA") (setq $file_search ($append (list '(mlist) "/tmp/foo.mac" "/tmp/foo.mc") $file_search)) and at maxima level: (C5) file_search:append(["/public/maxima/share/foo.mc"], file_search)$ (C6) load("eigen"); batching /usr/public/maxima/share/eigen.mc (D6) #/public/maxima/share/eigen.mc (C7) eigenvalues(matrix([a,b],[c,d])); 2 2 - SQRT(D - 2 A D + 4 B C + A ) + D + A (D7) [[---------------------------------------, 2 2 2 SQRT(D - 2 A D + 4 B C + A ) + D + A -------------------------------------], [1, 1]] 2 (C8)
(C1) INTEGRATE(1/(X^3+2),X)$ (C2) REVEAL(%,2); (D2) Negterm + Quotient + Quotient (C3) REVEAL(D1,3); ATAN LOG (D3) - Quotient + ---------- + ---------- Product(2) Product(2)
with_stdout("_hist.out", for i:1 thru length(hist) do ( print(i,hist[i]))), system("xgraph -bar -brw .7 -nl < _hist.out")
In order to make the plot be done in the background (returning control to maxima) and remove the temporary file after it is done do:
system("(xgraph -bar -brw .7 -nl < _hist.out; rm -f _hist.out)&")
mygnuplot(f,var,range,number_ticks):= block([numer:true], with_stdout("/tmp/gnu", for x:range[1] thru range[2] step (range[2]-range[1])/number_ticks do (print(x,at(f,var=x)))), system("echo \"set data style lines; set title '", f,"' ;plot '/tmp/gnu' ;pause 10 \" | gnuplot")); (C8) with_stdout("/home/wfs/joe", n:10, for i:8 thru n do(print("factorial(",i,") gives ",i!))); (D8) FALSE (C9) system("cat /home/wfs/joe"); factorial( 8 ) gives 40320 factorial( 9 ) gives 362880 factorial( 10 ) gives 3628800 (D9) 0