File: maxima_9.html

package info (click to toggle)
maxima 5.10.0-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 44,268 kB
  • ctags: 17,987
  • sloc: lisp: 152,894; fortran: 14,667; perl: 14,204; tcl: 10,103; sh: 3,376; makefile: 2,202; ansic: 471; awk: 7
file content (2116 lines) | stat: -rw-r--r-- 83,548 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html>
<!-- Created on September, 20 2006 by texi2html 1.76 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
            Karl Berry  <karl@freefriends.org>
            Olaf Bachmann <obachman@mathematik.uni-kl.de>
            and many others.
Maintained by: Many creative people <dev@texi2html.cvshome.org>
Send bugs and suggestions to <users@texi2html.cvshome.org>

-->
<head>
<title>Maxima Manual: 9. Input and Output</title>

<meta name="description" content="Maxima Manual: 9. Input and Output">
<meta name="keywords" content="Maxima Manual: 9. Input and Output">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 1.76">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
pre.display {font-family: serif}
pre.format {font-family: serif}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: serif; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: serif; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.sansserif {font-family:sans-serif; font-weight:normal;}
ul.toc {list-style: none}
body
{
    color: black;
    background: white; 
    margin-left: 8%;
    margin-right: 13%;
}

h1
{
    margin-left: +8%;
    font-size: 150%;
    font-family: sans-serif
}

h2
{
    font-size: 125%;
    font-family: sans-serif
}

h3
{
    font-size: 100%;
    font-family: sans-serif
}

h2,h3,h4,h5,h6 { margin-left: +4%; }

div.textbox
{
    border: solid;
    border-width: thin;
    /* width: 100%; */
    padding-top: 1em;
    padding-bottom: 1em;
    padding-left: 2em;
    padding-right: 2em
}

div.titlebox
{
    border: none;
    padding-top: 1em;
    padding-bottom: 1em;
    padding-left: 2em;
    padding-right: 2em;
    background: rgb(200,255,255);
    font-family: sans-serif
}

div.synopsisbox
{
    border: none;
    padding-top: 1em;
    padding-bottom: 1em;
    padding-left: 2em;
    padding-right: 2em;
     background: rgb(255,220,255);
    /*background: rgb(200,255,255); */
    /* font-family: fixed */
}

pre.example
{
    border: none;
    padding-top: 1em;
    padding-bottom: 1em;
    padding-left: 1em;
    padding-right: 1em;
    background: rgb(247,242,180); /* kind of sandy */
    /* background: rgb(200,255,255); */ /* sky blue */
    font-family: "Lucida Console", monospace
}

div.spacerbox
{
    border: none;
    padding-top: 2em;
    padding-bottom: 2em
}

div.image
{
    margin: 0;
    padding: 1em;
    text-align: center;
}
-->
</style>

<link rel="icon" href="http://maxima.sourceforge.net/favicon.ico"/>
</head>

<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">

<a name="Input-and-Output"></a>
<a name="SEC35"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="maxima_8.html#SEC34" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC36" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima_8.html#SEC33" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_10.html#SEC40" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h1 class="chapter"> 9. Input and Output </h1>

<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#SEC36">9.1 Introduction to Input and Output</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">  
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC37">9.2 Comments</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC38">9.3 Files</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">                       
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC39">9.4 Definitions for Input and Output</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">  
</td></tr>
</table>

<hr size="6">
<a name="Introduction-to-Input-and-Output"></a>
<a name="SEC36"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC35" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC37" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC35" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC35" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_10.html#SEC40" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section"> 9.1 Introduction to Input and Output </h2>

<hr size="6">
<a name="Comments"></a>
<a name="SEC37"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC36" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC38" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC35" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC35" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_10.html#SEC40" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section"> 9.2 Comments </h2>

<p>A comment in Maxima input is any text between <code>/*</code> and <code>*/</code>.
</p>
<p>The Maxima parser treats a comment as whitespace for the purpose of
finding tokens in the input stream;
a token always ends at a comment.
An input such as <code>a/* foo */b</code> contains two tokens, <code>a</code> and <code>b</code>,
and not a single token <code>ab</code>.
Comments are otherwise ignored by Maxima;
neither the content nor the location of comments is stored in parsed input expressions.
</p>
<p>Comments can be nested to arbitrary depth.
The <code>/*</code> and <code>*/</code> delimiters form matching pairs.
There must be the same number of <code>/*</code> as there are <code>*/</code>.
</p>
<p>Examples:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) /* aa is a variable of interest */  aa : 1234;
(%o1)                         1234
(%i2) /* Value of bb depends on aa */  bb : aa^2;
(%o2)                        1522756
(%i3) /* User-defined infix operator */  infix (&quot;b&quot;);
(%o3)                           b
(%i4) /* Parses same as a b c, not abc */  a/* foo */b/* bar */c;
(%o4)                         a b c
(%i5) /* Comments /* can be nested /* to arbitrary depth */ */ */  1 + xyz;
(%o5)                        xyz + 1
</pre></td></tr></table>

<hr size="6">
<a name="Files"></a>
<a name="SEC38"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC37" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC39" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC35" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC35" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_10.html#SEC40" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section"> 9.3 Files </h2>
<p>A file is simply an area on a particular storage device which contains data or text.
Files on the disks are figuratively grouped into &quot;directories&quot;.
A directory is just a list of files.
Commands which deal with files are:
<code>save</code>,
<code>load</code>,
<code>loadfile</code>,
<code>stringout</code>,
<code>batch</code>,
<code>demo</code>,
<code>writefile</code>,
<code>closefile</code>,
and
<code>appendfile</code>.
</p>
<hr size="6">
<a name="Definitions-for-Input-and-Output"></a>
<a name="SEC39"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC38" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="maxima_10.html#SEC40" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC35" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC35" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_10.html#SEC40" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section"> 9.4 Definitions for Input and Output </h2>

<dl>
<dt><u>System variable:</u> <b>__</b>
<a name="IDX260"></a>
</dt>
<dd><p><code>__</code> is the input expression currently being evaluated.
That is, while an input expression <var>expr</var> is being evaluated, <code>__</code> is <var>expr</var>.
</p>
<p><code>__</code> is assigned the input expression before the input is simplified or evaluated.
However, the value of <code>__</code> is simplified (but not evaluated) when it is displayed.
</p>
<p><code>__</code> is recognized by <code>batch</code> and <code>load</code>.
In a file processed by <code>batch</code>,
<code>__</code> has the same meaning as at the interactive prompt.
In a file processed by <code>load</code>,
<code>__</code> is bound to the input expression most recently entered at the interactive prompt
or in a batch file;
<code>__</code> is not bound to the input expressions in the file being processed.
In particular, when <code>load (<var>filename</var>)</code> is called from the interactive prompt,
<code>__</code> is bound to <code>load (<var>filename</var>)</code>
while the file is being processed.
</p>
<p>See also <code>_</code> and <code>%</code>.
</p>
<p>Examples:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) print (&quot;I was called as&quot;, __);
I was called as print(I was called as, __) 
(%o1)              print(I was called as, __)
(%i2) foo (__);
(%o2)                     foo(foo(__))
(%i3) g (x) := (print (&quot;Current input expression =&quot;, __), 0);
(%o3) g(x) := (print(&quot;Current input expression =&quot;, __), 0)
(%i4) [aa : 1, bb : 2, cc : 3];
(%o4)                       [1, 2, 3]
(%i5) (aa + bb + cc)/(dd + ee + g(x));
                            cc + bb + aa
Current input expression = -------------- 
                           g(x) + ee + dd
                                6
(%o5)                        -------
                             ee + dd
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>System variable:</u> <b>_</b>
<a name="IDX261"></a>
</dt>
<dd><p><code>_</code> is the most recent input expression (e.g., <code>%i1</code>, <code>%i2</code>, <code>%i3</code>, ...).
</p>
<p><code>_</code> is assigned the input expression before the input is simplified or evaluated.
However, the value of <code>_</code> is simplified (but not evaluated) when it is displayed.
</p>
<p><code>_</code> is recognized by <code>batch</code> and <code>load</code>.
In a file processed by <code>batch</code>,
<code>_</code> has the same meaning as at the interactive prompt.
In a file processed by <code>load</code>,
<code>_</code> is bound to the input expression most recently evaluated at the interactive prompt
or in a batch file;
<code>_</code> is not bound to the input expressions in the file being processed.
</p>
<p>See also <code>__</code> and <code>%</code>.
</p>
<p>Examples:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) 13 + 29;
(%o1)                          42
(%i2) :lisp $_
((MPLUS) 13 29)
(%i2) _;
(%o2)                          42
(%i3) sin (%pi/2);
(%o3)                           1
(%i4) :lisp $_
((%SIN) ((MQUOTIENT) $%PI 2))
(%i4) _;
(%o4)                           1
(%i5) a: 13$
(%i6) b: 29$
(%i7) a + b;
(%o7)                          42
(%i8) :lisp $_
((MPLUS) $A $B)
(%i8) _;
(%o8)                         b + a
(%i9) a + b;
(%o9)                          42
(%i10) ev (_);
(%o10)                         42
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>System variable:</u> <b>%</b>
<a name="IDX262"></a>
</dt>
<dd><p><code>%</code> is the output expression (e.g., <code>%o1</code>, <code>%o2</code>, <code>%o3</code>, ...)
most recently computed by Maxima,
whether or not it was displayed.
</p>
<p><code>%</code> is recognized by <code>batch</code> and <code>load</code>.
In a file processed by <code>batch</code>,
<code>%</code> has the same meaning as at the interactive prompt.
In a file processed by <code>load</code>,
<code>%</code> is bound to the output expression most recently computed at the interactive prompt
or in a batch file;
<code>%</code> is not bound to output expressions in the file being processed.
</p>
<p>See also <code>_</code>, <code>%%</code>, and <code>%th</code>.
</p>
</dd></dl>

<dl>
<dt><u>System variable:</u> <b>%%</b>
<a name="IDX263"></a>
</dt>
<dd><p>In compound statements,
namely <code>block</code>, <code>lambda</code>, or <code>(<var>s_1</var>, ..., <var>s_n</var>)</code>,
<code>%%</code> is the value of the previous statement.
For example,
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">block (integrate (x^5, x), ev (%%, x=2) - ev (%%, x=1));
block ([prev], prev: integrate (x^5, x), ev (prev, x=2) - ev (prev, x=1));
</pre></td></tr></table>
<p>yield the same result, namely <code>21/2</code>.
</p>
<p>A compound statement may comprise other compound statements.
Whether a statement be simple or compound, 
<code>%%</code> is the value of the previous statement.
For example,
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">block (block (a^n, %%*42), %%/6)
</pre></td></tr></table>
<p>yields <code>7*a^n</code>.
</p>
<p>Within a compound statement, the value of <code>%%</code> may be inspected at a break prompt,
which is opened by executing the <code>break</code> function.
For example, at the break prompt opened by
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">block (a: 42, break ())$
</pre></td></tr></table>
<p>entering <code>%%;</code> yields <code>42</code>.
</p>
<p>At the first statement in a compound statement,
or outside of a compound statement,
<code>%%</code> is undefined.
</p>
<p><code>%%</code> is recognized by <code>batch</code> and <code>load</code>,
and it has the same meaning as at the interactive prompt.
</p>
<p>See also <code>%</code>.
</p>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>%edispflag</b>
<a name="IDX264"></a>
</dt>
<dd><p>Default value: <code>false</code>
</p>
<p>When <code>%edispflag</code> is <code>true</code>,
Maxima displays <code>%e</code> to a negative exponent as a quotient.
For example, <code>%e^-x</code> is displayed as <code>1/%e^x</code>.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>%th</b><i> (<var>i</var>)</i>
<a name="IDX265"></a>
</dt>
<dd><p>The value of the <var>i</var>'th previous output expression.
That is, if the next expression to be computed is the <var>n</var>'th output,
<code>%th (<var>m</var>)</code> is the (<var>n</var> - <var>m</var>)'th output.
</p>
<p><code>%th</code> is useful in <code>batch</code> files or for referring to a group of output expressions.
For example,
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">block (s: 0, for i:1 thru 10 do s: s + %th (i))$
</pre></td></tr></table>
<p>sets <code>s</code> to the sum of the last ten output expressions.
</p>
<p><code>%th</code> is recognized by <code>batch</code> and <code>load</code>.
In a file processed by <code>batch</code>,
<code>%th</code> has the same meaning as at the interactive prompt.
In a file processed by <code>load</code>,
<code>%th</code> refers to output expressions most recently computed at the interactive prompt
or in a batch file;
<code>%th</code> does not refer to output expressions in the file being processed.
</p>
<p>See also <code>%</code>.
</p>
</dd></dl>

<dl>
<dt><u>Special symbol:</u> <b>?</b>
<a name="IDX266"></a>
</dt>
<dd><p>As prefix to a function or variable name, <code>?</code> signifies that the
name is a Lisp name, not a Maxima name.
For example, <code>?round</code> signifies the Lisp function <code>ROUND</code>.
See <a href="maxima_3.html#SEC7">Lisp and Maxima</a> for more on this point.
</p>
<p>The notation <code>? word</code> (a question mark followed a word, separated by whitespace)
is equivalent to <code>describe (&quot;word&quot;)</code>.
</p>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>absboxchar</b>
<a name="IDX267"></a>
</dt>
<dd><p>Default value: <code>!</code>
</p>
<p><code>absboxchar</code> is the character used to draw absolute value
signs around expressions which are more than one line tall.
</p>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>file_output_append</b>
<a name="IDX268"></a>
</dt>
<dd><p>Default value: <code>false</code>
</p>
<p><code>file_output_append</code> governs whether file output functions
append or truncate their output file.
When <code>file_output_append</code> is <code>true</code>,
such functions append to their output file.
Otherwise, the output file is truncated.
</p>
<p><code>save</code>, <code>stringout</code>, and <code>with_stdout</code> respect <code>file_output_append</code>.
Other functions which write output files do not respect <code>file_output_append</code>.
In particular, plotting and translation functions always truncate their output file,
and <code>tex</code> and <code>appendfile</code> always append.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>appendfile</b><i> (<var>filename</var>)</i>
<a name="IDX269"></a>
</dt>
<dd><p>Appends a console transcript to <var>filename</var>.
<code>appendfile</code> is the same as <code>writefile</code>, 
except that the transcript file, if it exists, is always appended.
</p>
<p><code>closefile</code> closes the transcript file opened by <code>appendfile</code> or <code>writefile</code>.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>batch</b><i> (<var>filename</var>)</i>
<a name="IDX270"></a>
</dt>
<dd><p>Reads Maxima expressions from <var>filename</var> and evaluates them.
<code>batch</code> searches for <var>filename</var> in the list <code>file_search_maxima</code>.
See <code>file_search</code>.
</p>
<p><var>filename</var> comprises a sequence of Maxima expressions,
each terminated with <code>;</code> or <code>$</code>.
The special variable <code>%</code> and the function <code>%th</code>
refer to previous results within the file.
The file may include <code>:lisp</code> constructs.
Spaces, tabs, and newlines in the file are ignored.
A suitable input file may be created by a text editor or by the <code>stringout</code> function.
</p>
<p><code>batch</code> reads each input expression from <var>filename</var>,
displays the input to the console, 
computes the corresponding output expression,
and displays the output expression.
Input labels are assigned to the input expressions
and output labels are assigned to the output expressions.
<code>batch</code> evaluates every input expression in the file
unless there is an error.
If user input is requested (by <code>asksign</code> or <code>askinteger</code>, for example)
<code>batch</code> pauses to collect the requisite input and then continue.
</p>
<p>It may be possible to halt <code>batch</code> by typing <code>control-C</code> at the console.
The effect of <code>control-C</code> depends on the underlying Lisp implementation.
</p>
<p><code>batch</code> has several uses,
such as to provide a reservoir for working command lines,
to give error-free demonstrations,
or to help organize one's thinking in solving complex problems.
</p>
<p><code>batch</code> evaluates its argument.
<code>batch</code> has no return value.
</p>
<p>See also <code>load</code>, <code>batchload</code>, and <code>demo</code>.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>batchload</b><i> (<var>filename</var>)</i>
<a name="IDX271"></a>
</dt>
<dd><p>Reads Maxima expressions from <var>filename</var> and evaluates them,
without displaying the input or output expressions
and without assigning labels to output expressions.
Printed output (such as produced by <code>print</code> or <code>describe</code>)
is displayed, however.
</p>
<p>The special variable <code>%</code> and the function <code>%th</code>
refer to previous results from the interactive interpreter,
not results within the file.
The file cannot include <code>:lisp</code> constructs.
</p>
<p><code>batchload</code> returns the path of <var>filename</var>, as a string.
<code>batchload</code> evaluates its argument.
</p>
<p>See also <code>batch</code> and <code>load</code>.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>closefile</b><i> ()</i>
<a name="IDX272"></a>
</dt>
<dd><p>Closes the transcript file opened by <code>writefile</code> or <code>appendfile</code>.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>collapse</b><i> (<var>expr</var>)</i>
<a name="IDX273"></a>
</dt>
<dd><p>Collapses <var>expr</var> by causing all of its
common (i.e., equal) subexpressions to share (i.e., use the same cells),
thereby saving space.  (<code>collapse</code> is a subroutine used by the <code>optimize</code>
command.)  Thus, calling <code>collapse</code> may be useful
after loading in a <code>save</code> file.  You can collapse several expressions
together by using <code>collapse ([<var>expr_1</var>, ..., <var>expr_n</var>])</code>.  Similarly, you can
collapse the elements of the array <code>A</code> by doing
<code>collapse (listarray ('A))</code>.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>concat</b><i> (<var>arg_1</var>, <var>arg_2</var>, ...)</i>
<a name="IDX274"></a>
</dt>
<dd><p>Concatenates its arguments.
The arguments must evaluate to atoms.
The return value is a symbol if the first argument is a symbol
and a Maxima string otherwise.
</p>
<p><code>concat</code> evaluates its arguments.
The single quote <code>'</code> prevents evaluation.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) y: 7$
(%i2) z: 88$
(%i3) concat (y, z/2);
(%o3)                          744
(%i4) concat ('y, z/2);
(%o4)                          y44
</pre></td></tr></table>
<p>A symbol constructed by <code>concat</code> may
be assigned a value and appear in expressions.
The <code>::</code> (double colon) assignment operator evaluates its left-hand side.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i5) a: concat ('y, z/2);
(%o5)                          y44
(%i6) a:: 123;
(%o6)                          123
(%i7) y44;
(%o7)                          123
(%i8) b^a;
                               y44
(%o8)                         b
(%i9) %, numer;
                               123
(%o9)                         b
</pre></td></tr></table>
<p>Note that although <code>concat (1, 2)</code> looks like a number, it is a Maxima string.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i10) concat (1, 2) + 3;
(%o10)                       12 + 3
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>sconcat</b><i> (<var>arg_1</var>, <var>arg_2</var>, ...)</i>
<a name="IDX275"></a>
</dt>
<dd><p>Concatenates its arguments into a string.
Unlike <code>concat</code>, the arguments do <i>not</i> need to be atoms.
</p>
<p>The result is a Lisp string.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) sconcat (&quot;xx[&quot;, 3, &quot;]:&quot;, expand ((x+y)^3));
(%o1)               xx[3]:y^3+3*x*y^2+3*x^2*y+x^3
</pre></td></tr></table>
</dd></dl>


<dl>
<dt><u>Function:</u> <b>disp</b><i> (<var>expr_1</var>, <var>expr_2</var>, ...)</i>
<a name="IDX276"></a>
</dt>
<dd><p>is like <code>display</code> but only the value of the
arguments are displayed rather than equations.  This is useful for
complicated arguments which don't have names or where only the value
of the argument is of interest and not the name.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>dispcon</b><i> (<var>tensor_1</var>, <var>tensor_2</var>, ...)</i>
<a name="IDX277"></a>
</dt>
<dt><u>Function:</u> <b>dispcon</b><i> (all)</i>
<a name="IDX278"></a>
</dt>
<dd><p>Displays the contraction properties of
its arguments as were given to <code>defcon</code>.  <code>dispcon (all)</code> displays all the
contraction properties which were defined.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>display</b><i> (<var>expr_1</var>, <var>expr_2</var>, ...)</i>
<a name="IDX279"></a>
</dt>
<dd><p>Displays equations whose left side is
<var>expr_i</var> unevaluated, and whose right side is the value of the expression
centered on the line.  This function is useful in blocks and <code>for</code>
statements in order to have intermediate results displayed.  The
arguments to <code>display</code> are usually atoms, subscripted variables, or
function calls.  See also <code>disp</code>.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) display(B[1,2]);
                                      2
                         B     = X - X
                          1, 2
(%o1)                            done
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>display2d</b>
<a name="IDX280"></a>
</dt>
<dd><p>Default value: <code>true</code>
</p>
<p>When <code>display2d</code> is <code>false</code>,
the console display is a string (1-dimensional) form rather than a display
(2-dimensional) form.
</p>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>display_format_internal</b>
<a name="IDX281"></a>
</dt>
<dd><p>Default value: <code>false</code>
</p>
<p>When <code>display_format_internal</code> is <code>true</code>,
expressions are displayed without being transformed in ways that
hide the internal mathematical representation.  The display then
corresponds to what <code>inpart</code> returns rather than <code>part</code>.
</p>
<p>Examples:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">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
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>dispterms</b><i> (<var>expr</var>)</i>
<a name="IDX282"></a>
</dt>
<dd><p>Displays <var>expr</var> in parts one below the other.
That is, first the operator of <var>expr</var> is displayed, then each term in
a sum, or factor in a product, or part of a more general expression is
displayed separately.  This is useful if <var>expr</var> is too large to be
otherwise displayed.  For example if <code>P1</code>, <code>P2</code>, ...  are very large
expressions then the display program may run out of storage space in
trying to display <code>P1 + P2 + ...</code>  all at once.  However,
<code>dispterms (P1 + P2 + ...)</code> displays <code>P1</code>, then below it <code>P2</code>, etc.  When not
using <code>dispterms</code>, if an exponential expression is too wide to be
displayed as <code>A^B</code> it appears as <code>expt (A, B)</code> (or as <code>ncexpt (A, B)</code> in
the case of <code>A^^B</code>).
</p>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>error_size</b>
<a name="IDX283"></a>
</dt>
<dd><p>Default value: 10
</p>
<p><code>error_size</code> modifies error messages according to the size of expressions which appear in them.
If the size of an expression (as determined by the Lisp function <code>ERROR-SIZE</code>)
is greater than <code>error_size</code>,
the expression is replaced in the message by a symbol,
and the symbol is assigned the expression.
The symbols are taken from the list <code>error_syms</code>.
</p>
<p>Otherwise, the expression is smaller than <code>error_size</code>,
and the expression is displayed in the message.
</p>
<p>See also <code>error</code> and <code>error_syms</code>.
</p>
<p>Example:
</p>
<p>The size of <code>U</code>, as determined by <code>ERROR-SIZE</code>, is 24.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) U: (C^D^E + B + A)/(cos(X-1) + 1)$

(%i2) error_size: 20$

(%i3) error (&quot;Example expression is&quot;, U);

Example expression is errexp1
 -- an error.  Quitting.  To debug this try debugmode(true);
(%i4) errexp1;
                            E
                           D
                          C   + B + A
(%o4)                    --------------
                         cos(X - 1) + 1
(%i5) error_size: 30$

(%i6) error (&quot;Example expression is&quot;, U);

                         E
                        D
                       C   + B + A
Example expression is --------------
                      cos(X - 1) + 1
 -- an error.  Quitting.  To debug this try debugmode(true);
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>error_syms</b>
<a name="IDX284"></a>
</dt>
<dd><p>Default value: <code>[errexp1, errexp2, errexp3]</code>
</p>
<p>In error messages,
expressions larger than <code>error_size</code> are replaced by symbols, and the
symbols are set to the expressions.  The symbols are taken from the
list <code>error_syms</code>.
The first too-large expression is replaced by <code>error_syms[1]</code>,
the second by <code>error_syms[2]</code>, and so on.
</p>
<p>If there are more too-large expressions than there are elements of <code>error_syms</code>,
symbols are constructed automatically,
with the <var>n</var>-th symbol equivalent to <code>concat ('errexp, <var>n</var>)</code>.
</p>
<p>See also <code>error</code> and <code>error_size</code>.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>expt</b><i> (<var>a</var>, <var>b</var>)</i>
<a name="IDX285"></a>
</dt>
<dd><p>If an exponential expression is too wide to be displayed
as <code><var>a</var>^<var>b</var></code> it appears as <code>expt (<var>a</var>, <var>b</var>)</code> (or as <code>ncexpt (<var>a</var>, <var>b</var>)</code> in the case of
<code><var>a</var>^^<var>b</var></code>).
</p>
<p><code>expt</code> and <code>ncexpt</code> are not recognized in input.
</p>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>exptdispflag</b>
<a name="IDX286"></a>
</dt>
<dd><p>Default value: <code>true</code>
</p>
<p>When <code>exptdispflag</code> is <code>true</code>, Maxima displays expressions
with negative exponents using quotients, e.g., <code>X^(-1)</code> as <code>1/X</code>.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>filename_merge</b><i> (<var>path</var>, <var>filename</var>)</i>
<a name="IDX287"></a>
</dt>
<dd><p>Constructs a modified path from <var>path</var> and <var>filename</var>.
If the final component of <var>path</var> is of the form <code>###.<var>something</var></code>,
the component is replaced with <code><var>filename</var>.<var>something</var></code>.
Otherwise, the final component is simply replaced by <var>filename</var>.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>file_search</b><i> (<var>filename</var>)</i>
<a name="IDX288"></a>
</dt>
<dt><u>Function:</u> <b>file_search</b><i> (<var>filename</var>, <var>pathlist</var>)</i>
<a name="IDX289"></a>
</dt>
<dd><p><code>file_search</code> searches for the file <var>filename</var> and returns the path to the file
(as a string) if it can be found; otherwise <code>file_search</code> returns <code>false</code>.
<code>file_search (<var>filename</var>)</code> searches in the default search directories,
which are specified by the <code>file_search_maxima</code>, <code>file_search_lisp</code>, and <code>file_search_demo</code> variables.
</p>
<p><code>file_search</code> first checks if the actual name passed exists,
before attempting to match it to &quot;wildcard&quot; file search patterns.
See <code>file_search_maxima</code> concerning file search patterns.
</p>
<p>The argument <var>filename</var> can be a path and file name,
or just a file name, or, if a file search directory includes a file search pattern,
just the base of the file name (without an extension).
For example,
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">file_search (&quot;/home/wfs/special/zeta.mac&quot;);
file_search (&quot;zeta.mac&quot;);
file_search (&quot;zeta&quot;);
</pre></td></tr></table>
<p>all find the same file, assuming the file exists and <code>/home/wfs/special/###.mac</code>
is in <code>file_search_maxima</code>.
</p>
<p><code>file_search (<var>filename</var>, <var>pathlist</var>)</code> searches only in the directories
specified by <var>pathlist</var>,
which is a list of strings.
The argument <var>pathlist</var> supersedes the default search directories,
so if the path list is given, <code>file_search</code> searches only the ones specified,
and not any of the default search directories.
Even if there is only one directory in <var>pathlist</var>, it must still be given as a one-element list.
</p>
<p>The user may modify the default search directories. See <code>file_search_maxima</code>.
</p>
<p><code>file_search</code> is invoked by <code>load</code> with <code>file_search_maxima</code> and <code>file_search_lisp</code>
as the search directories.
</p>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>file_search_maxima</b>
<a name="IDX290"></a>
</dt>
<dt><u>Option variable:</u> <b>file_search_lisp</b>
<a name="IDX291"></a>
</dt>
<dt><u>Option variable:</u> <b>file_search_demo</b>
<a name="IDX292"></a>
</dt>
<dd><p>These variables specify lists of directories to be searched
by <code>load</code>, <code>demo</code>, and some other Maxima functions.
The default values of these variables
name various directories in the Maxima installation.
</p>
<p>The user can modify these variables,
either to replace the default values or to append additional directories.
For example,
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">file_search_maxima: [&quot;/usr/local/foo/###.mac&quot;,
    &quot;/usr/local/bar/###.mac&quot;]$
</pre></td></tr></table>
<p>replaces the default value of <code>file_search_maxima</code>,
while
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">file_search_maxima: append (file_search_maxima,
    [&quot;/usr/local/foo/###.mac&quot;, &quot;/usr/local/bar/###.mac&quot;])$
</pre></td></tr></table>
<p>appends two additional directories.
It may be convenient to put such an expression in the file <code>maxima-init.mac</code>
so that the file search path is assigned automatically when Maxima starts.
</p>
<p>Multiple filename extensions and multiple paths can be specified by
special &quot;wildcard&quot; constructions.
The string <code>###</code> expands into the sought-after name,
while a comma-separated list enclosed in curly braces <code>{foo,bar,baz}</code> expands
into multiple strings.
For example, supposing the sought-after name is <code>neumann</code>,
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">&quot;/home/{wfs,gcj}/###.{lisp,mac}&quot;
</pre></td></tr></table>
<p>expands into <code>/home/wfs/neumann.lisp</code>, <code>/home/gcj/neumann.lisp</code>, <code>/home/wfs/neumann.mac</code>, and <code>/home/gcj/neumann.mac</code>.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>file_type</b><i> (<var>filename</var>)</i>
<a name="IDX293"></a>
</dt>
<dd><p>Returns a guess about the content of <var>filename</var>,
based on the filename extension.
<var>filename</var> need not refer to an actual file;
no attempt is made to open the file and inspect the content.
</p>
<p>The return value is a symbol, either <code>object</code>, <code>lisp</code>, or <code>maxima</code>.
If the extension starts with <code>m</code> or <code>d</code>, <code>file_type</code> returns <code>maxima</code>.
If the extension starts with <code>l</code>, <code>file_type</code> returns <code>lisp</code>.
If none of the above, <code>file_type</code> returns <code>object</code>.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>grind</b><i> (<var>expr</var>)</i>
<a name="IDX294"></a>
</dt>
<dt><u>Option variable:</u> <b>grind</b>
<a name="IDX295"></a>
</dt>
<dd><p>The function <code>grind</code> prints <var>expr</var>
to the console in a form suitable for input to Maxima.
<code>grind</code> always returns <code>done</code>.
</p>
<p>When <var>expr</var> is the name of a function or macro,
<code>grind</code> prints the function or macro definition instead of just the name.
</p>
<p>See also <code>string</code>, which returns a string instead of printing its output.
<code>grind</code> attempts to print the expression in a manner which makes it
slightly easier to read than the output of <code>string</code>.
</p>
<p>When the variable <code>grind</code> is <code>true</code>,
the output of <code>string</code> and <code>stringout</code> has the same format as that of <code>grind</code>;
otherwise no attempt is made to specially format the output of those functions.
The default value of the variable <code>grind</code> is <code>false</code>.
</p>
<p><code>grind</code> can also be specified as an argument of <code>playback</code>.
When <code>grind</code> is present,
<code>playback</code> prints input expressions in the same format as the <code>grind</code> function.
Otherwise, no attempt is made to specially format input expressions.
</p>
<p><code>grind</code> evaluates its argument.
</p>
<p>Examples:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) aa + 1729;
(%o1)                       aa + 1729
(%i2) grind (%);
aa+1729$
(%o2)                         done
(%i3) [aa, 1729, aa + 1729];
(%o3)                 [aa, 1729, aa + 1729]
(%i4) grind (%);
[aa,1729,aa+1729]$
(%o4)                         done
(%i5) matrix ([aa, 17], [29, bb]);
                           [ aa  17 ]
(%o5)                      [        ]
                           [ 29  bb ]
(%i6) grind (%);
matrix([aa,17],[29,bb])$
(%o6)                         done
(%i7) set (aa, 17, 29, bb);
(%o7)                   {17, 29, aa, bb}
(%i8) grind (%);
{17,29,aa,bb}$
(%o8)                         done
(%i9) exp (aa / (bb + 17)^29);
                                aa
                            -----------
                                     29
                            (bb + 17)
(%o9)                     %e
(%i10) grind (%);
%e^(aa/(bb+17)^29)$
(%o10)                        done
(%i11) expr: expand ((aa + bb)^10);
         10           9        2   8         3   7         4   6
(%o11) bb   + 10 aa bb  + 45 aa  bb  + 120 aa  bb  + 210 aa  bb
         5   5         6   4         7   3        8   2
 + 252 aa  bb  + 210 aa  bb  + 120 aa  bb  + 45 aa  bb
        9        10
 + 10 aa  bb + aa
(%i12) grind (expr);
bb^10+10*aa*bb^9+45*aa^2*bb^8+120*aa^3*bb^7+210*aa^4*bb^6
     +252*aa^5*bb^5+210*aa^6*bb^4+120*aa^7*bb^3+45*aa^8*bb^2
     +10*aa^9*bb+aa^10$
(%o12)                        done
(%i13) string (expr);
(%o13) bb^10+10*aa*bb^9+45*aa^2*bb^8+120*aa^3*bb^7+210*aa^4*bb^6\
+252*aa^5*bb^5+210*aa^6*bb^4+120*aa^7*bb^3+45*aa^8*bb^2+10*aa^9*\
bb+aa^10
(%i14) cholesky (A):= block ([n : length (A), L : copymatrix (A),
p : makelist (0, i, 1, length (A))], for i thru n do for j : i thru n do
(x : L[i, j], x : x - sum (L[j, k] * L[i, k], k, 1, i - 1), if i = j then
p[i] : 1 / sqrt(x) else L[j, i] : x * p[i]), for i thru n do L[i, i] : 1 / p[i],
for i thru n do for j : i + 1 thru n do L[i, j] : 0, L)$
(%i15) grind (cholesky);
cholesky(A):=block(
         [n:length(A),L:copymatrix(A),
          p:makelist(0,i,1,length(A))],
         for i thru n do
             (for j from i thru n do
                  (x:L[i,j],x:x-sum(L[j,k]*L[i,k],k,1,i-1),
                   if i = j then p[i]:1/sqrt(x)
                       else L[j,i]:x*p[i])),
         for i thru n do L[i,i]:1/p[i],
         for i thru n do (for j from i+1 thru n do L[i,j]:0),L)$
(%o15)                        done
(%i16) string (fundef (cholesky));
(%o16) cholesky(A):=block([n:length(A),L:copymatrix(A),p:makelis\
t(0,i,1,length(A))],for i thru n do (for j from i thru n do (x:L\
[i,j],x:x-sum(L[j,k]*L[i,k],k,1,i-1),if i = j then p[i]:1/sqrt(x\
) else L[j,i]:x*p[i])),for i thru n do L[i,i]:1/p[i],for i thru \
n do (for j from i+1 thru n do L[i,j]:0),L)
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>ibase</b>
<a name="IDX296"></a>
</dt>
<dd><p>Default value: 10
</p>
<p>Integers entered into Maxima are interpreted
with respect to the base <code>ibase</code>.
</p>
<p><code>ibase</code> may be assigned any integer between 2 and 35 (decimal), inclusive.
When <code>ibase</code> is greater than 10, the numerals comprise the decimal numerals 0 through 9
plus capital letters of the alphabet A, B, C, ..., as needed.
The numerals for base 35, the largest acceptable base,
comprise 0 through 9 and A through Y.
</p>
<p>See also <code>obase</code>.
</p>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>inchar</b>
<a name="IDX297"></a>
</dt>
<dd><p>Default value: <code>%i</code>
</p>
<p><code>inchar</code> is the prefix of the labels of expressions entered by the user.
Maxima automatically constructs a label for each input expression
by concatenating <code>inchar</code> and <code>linenum</code>.
<code>inchar</code> may be assigned any string or symbol, not necessarily a single character.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) inchar: &quot;input&quot;;
(%o1)                                input
(input1) expand ((a+b)^3);
                            3        2      2      3
(%o1)                      b  + 3 a b  + 3 a  b + a
(input2)
</pre></td></tr></table>
<p>See also <code>labels</code>.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>ldisp</b><i> (<var>expr_1</var>, ..., <var>expr_n</var>)</i>
<a name="IDX298"></a>
</dt>
<dd><p>Displays expressions <var>expr_1</var>, ..., <var>expr_n</var> to the console
as printed output.
<code>ldisp</code> assigns an intermediate expression label to each argument
and returns the list of labels.
</p>
<p>See also <code>disp</code>.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) e: (a+b)^3;
                                   3
(%o1)                       (b + a)
(%i2) f: expand (e);
                     3        2      2      3
(%o2)               b  + 3 a b  + 3 a  b + a
(%i3) ldisp (e, f);
                                   3
(%t3)                       (b + a)

                     3        2      2      3
(%t4)               b  + 3 a b  + 3 a  b + a

(%o4)                      [%t3, %t4]
(%i4) %t3;
                                   3
(%o4)                       (b + a)
(%i5) %t4;
                     3        2      2      3
(%o5)               b  + 3 a b  + 3 a  b + a
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>ldisplay</b><i> (<var>expr_1</var>, ..., <var>expr_n</var>)</i>
<a name="IDX299"></a>
</dt>
<dd><p>Displays expressions <var>expr_1</var>, ..., <var>expr_n</var> to the console
as printed output.
Each expression is printed as an equation of the form <code>lhs = rhs</code>
in which <code>lhs</code> is one of the arguments of <code>ldisplay</code>
and <code>rhs</code> is its value.
Typically each argument is a variable.
<code>ldisp</code> assigns an intermediate expression label to each equation
and returns the list of labels.
</p>
<p>See also <code>display</code>.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) e: (a+b)^3;
                                   3
(%o1)                       (b + a)
(%i2) f: expand (e);
                     3        2      2      3
(%o2)               b  + 3 a b  + 3 a  b + a
(%i3) ldisplay (e, f);
                                     3
(%t3)                     e = (b + a)

                       3        2      2      3
(%t4)             f = b  + 3 a b  + 3 a  b + a

(%o4)                      [%t3, %t4]
(%i4) %t3;
                                     3
(%o4)                     e = (b + a)
(%i5) %t4;
                       3        2      2      3
(%o5)             f = b  + 3 a b  + 3 a  b + a
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>linechar</b>
<a name="IDX300"></a>
</dt>
<dd><p>Default value: <code>%t</code>
</p>
<p><code>linechar</code> is the prefix of the labels of intermediate expressions generated by Maxima.
Maxima constructs a label for each intermediate expression (if displayed)
by concatenating <code>linechar</code> and <code>linenum</code>.
<code>linechar</code> may be assigned any string or symbol, not necessarily a single character.
</p>
<p>Intermediate expressions might or might not be displayed.
See <code>programmode</code> and <code>labels</code>.
</p>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>linel</b>
<a name="IDX301"></a>
</dt>
<dd><p>Default value: 79
</p>
<p><code>linel</code> is the assumed width (in characters) of the console display
for the purpose of displaying expressions.
<code>linel</code> may be assigned any value by the user,
although very small or very large values may be impractical.
Text printed by built-in Maxima functions, such as error messages and the output of <code>describe</code>,
is not affected by <code>linel</code>.
</p>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>lispdisp</b>
<a name="IDX302"></a>
</dt>
<dd><p>Default value: <code>false</code>
</p>
<p>When <code>lispdisp</code> is <code>true</code>,
Lisp symbols are displayed with a leading question mark <code>?</code>.
Otherwise,
Lisp symbols are displayed with no leading mark.
</p>
<p>Examples:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) lispdisp: false$
(%i2) ?foo + ?bar;
(%o2)                       foo + bar
(%i3) lispdisp: true$
(%i4) ?foo + ?bar;
(%o4)                      ?foo + ?bar
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>load</b><i> (<var>filename</var>)</i>
<a name="IDX303"></a>
</dt>
<dd><p>Evaluates expressions in <var>filename</var>, 
thus bringing variables, functions, and other objects into Maxima.
The binding of any existing object is clobbered by the binding recovered from <var>filename</var>. 
To find the file,
<code>load</code> calls <code>file_search</code> with <code>file_search_maxima</code> and <code>file_search_lisp</code>
as the search directories.
If <code>load</code> succeeds, it returns the name of the file.
Otherwise <code>load</code> prints an error message.
</p>
<p><code>load</code> works equally well for Lisp code and Maxima code.
Files created by <code>save</code>, <code>translate_file</code>, and <code>compile_file</code>, which create Lisp code,
and <code>stringout</code>, which creates Maxima code,
can all be processed by <code>load</code>.
<code>load</code> calls <code>loadfile</code> to load Lisp files and <code>batchload</code> to load Maxima files.
</p>
<p><code>load</code> does not recognize <code>:lisp</code> constructs in Maxima files,
and while processing <var>filename</var>,
the global variables <code>_</code>, <code>__</code>, <code>%</code>, and <code>%th</code> have whatever bindings
they had when <code>load</code> was called.
</p>
<p>See also <code>loadfile</code>, <code>batch</code>, <code>batchload</code>, and <code>demo</code>.
<code>loadfile</code> processes Lisp files;
<code>batch</code>, <code>batchload</code>, and <code>demo</code> process Maxima files.
</p>
<p>See <code>file_search</code> for more detail about the file search mechanism.
</p>
<p><code>load</code> evaluates its argument.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>loadfile</b><i> (<var>filename</var>)</i>
<a name="IDX304"></a>
</dt>
<dd><p>Evaluates Lisp expressions in <var>filename</var>.
<code>loadfile</code> does not invoke <code>file_search</code>, so <code>filename</code> must include
the file extension and as much of the path as needed to find the file.
</p>
<p><code>loadfile</code> can process files created by <code>save</code>, <code>translate_file</code>, and <code>compile_file</code>.
The user may find it more convenient to use <code>load</code> instead of <code>loadfile</code>.
</p>
<p><code>loadfile</code> quotes its argument, so <code>filename</code> must be a literal string,
not a string variable.
The quote-quote operator <code>''</code> defeats quotation.
</p>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>loadprint</b>
<a name="IDX305"></a>
</dt>
<dd><p>Default value: <code>true</code>
</p>
<p><code>loadprint</code> tells whether to print a message when a file is loaded.
</p>
<ul>
<li>
When <code>loadprint</code> is <code>true</code>, always print a message.
</li><li>
When <code>loadprint</code> is <code>'loadfile</code>, print a message only if
a file is loaded by the function <code>loadfile</code>.
</li><li>
When <code>loadprint</code> is <code>'autoload</code>,
print a message only if a file is automatically loaded.
See <code>setup_autoload</code>.
</li><li>
When <code>loadprint</code> is <code>false</code>, never print a message.
</li></ul>

</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>obase</b>
<a name="IDX306"></a>
</dt>
<dd><p>Default value: 10
</p>
<p><code>obase</code> is the base for integers displayed by Maxima.
</p>
<p><code>obase</code> may be assigned any integer between 2 and 35 (decimal), inclusive.
When <code>obase</code> is greater than 10, the numerals comprise the decimal numerals 0 through 9
plus capital letters of the alphabet A, B, C, ..., as needed.
The numerals for base 35, the largest acceptable base,
comprise 0 through 9, and A through Y.
</p>
<p>See also <code>ibase</code>.
</p>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>outchar</b>
<a name="IDX307"></a>
</dt>
<dd><p>Default value: <code>%o</code>
</p>
<p><code>outchar</code> is the prefix of the labels of expressions computed by Maxima.
Maxima automatically constructs a label for each computed expression
by concatenating <code>outchar</code> and <code>linenum</code>.
<code>outchar</code> may be assigned any string or symbol, not necessarily a single character.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) outchar: &quot;output&quot;;
(output1)                           output
(%i2) expand ((a+b)^3);
                            3        2      2      3
(output2)                  b  + 3 a b  + 3 a  b + a
(%i3)
</pre></td></tr></table>
<p>See also <code>labels</code>.
</p>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>packagefile</b>
<a name="IDX308"></a>
</dt>
<dd><p>Default value: <code>false</code>
</p>
<p>Package designers who use <code>save</code>
or <code>translate</code> to create packages (files) for others
to use may want to set <code>packagefile: true</code> to prevent information
from being added to Maxima's information-lists (e.g. <code>values</code>,
<code>functions</code>) except where necessary when the file is loaded in.
In this way, the contents of the package will not get in the
user's way when he adds his own data.  Note that this will not
solve the problem of possible name conflicts.  Also note that
the flag simply affects what is output to the package file.
Setting the flag to <code>true</code> is also useful for creating Maxima
init files.
</p>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>pfeformat</b>
<a name="IDX309"></a>
</dt>
<dd><p>Default value: <code>false</code>
</p>
<p>When <code>pfeformat</code> is <code>true</code>, a ratio of integers is
displayed with the solidus (forward slash) character,
and an integer denominator <code>n</code>
is displayed as a leading multiplicative term <code>1/n</code>.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) pfeformat: false$
(%i2) 2^16/7^3;
                              65536
(%o2)                         -----
                               343
(%i3) (a+b)/8;
                              b + a
(%o3)                         -----
                                8
(%i4) pfeformat: true$ 
(%i5) 2^16/7^3;
(%o5)                       65536/343
(%i6) (a+b)/8;
(%o6)                      1/8 (b + a)
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>print</b><i> (<var>expr_1</var>, ..., <var>expr_n</var>)</i>
<a name="IDX310"></a>
</dt>
<dd><p>Evaluates and displays <var>expr_1</var>, ..., <var>expr_n</var>
one after another, from left to right,
starting at the left edge of the console display.
</p>
<p>The value returned by <code>print</code> is the value of its last argument.
<code>print</code> does not generate intermediate expression labels.
</p>
<p>See also <code>display</code>, <code>disp</code>, <code>ldisplay</code>, and <code>ldisp</code>.
Those functions display one expression per line, while <code>print</code> attempts
to display two or more expressions per line.
</p>
<p>To display the contents of a file, see <code>printfile</code>.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) r: print (&quot;(a+b)^3 is&quot;, expand ((a+b)^3), &quot;log (a^10/b) is&quot;, radcan (log (a^10/b)))$
            3        2      2      3
(a+b)^3 is b  + 3 a b  + 3 a  b + a  log (a^10/b) is 

                                              10 log(a) - log(b) 
(%i2) r;
(%o2)                  10 log(a) - log(b)
(%i3) disp (&quot;(a+b)^3 is&quot;, expand ((a+b)^3), &quot;log (a^10/b) is&quot;, radcan (log (a^10/b)))$
                           (a+b)^3 is

                     3        2      2      3
                    b  + 3 a b  + 3 a  b + a

                         log (a^10/b) is

                       10 log(a) - log(b)
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>tcl_output</b><i> (<var>list</var>, <var>i0</var>, <var>skip</var>)</i>
<a name="IDX311"></a>
</dt>
<dt><u>Function:</u> <b>tcl_output</b><i> (<var>list</var>, <var>i0</var>)</i>
<a name="IDX312"></a>
</dt>
<dt><u>Function:</u> <b>tcl_output</b><i> ([<var>list_1</var>, ..., <var>list_n</var>], <var>i</var>)</i>
<a name="IDX313"></a>
</dt>
<dd><p>Prints elements of a list enclosed by curly braces <code>{ }</code>,
suitable as part of a program in the Tcl/Tk language.
</p>
<p><code>tcl_output (<var>list</var>, <var>i0</var>, <var>skip</var>)</code>
prints <var>list</var>, beginning with element <var>i0</var> and printing elements
<code><var>i0</var> + <var>skip</var></code>, <code><var>i0</var> + 2 <var>skip</var></code>, etc.
</p>
<p><code>tcl_output (<var>list</var>, <var>i0</var>)</code>
is equivalent to <code>tcl_output (<var>list</var>, <var>i0</var>, 2)</code>.
</p>
<p><code>tcl_output ([<var>list_1</var>, ..., <var>list_n</var>], <var>i</var>)</code>
prints the <var>i</var>'th elements of <var>list_1</var>, ..., <var>list_n</var>.
</p>
<p>Examples:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) tcl_output ([1, 2, 3, 4, 5, 6], 1, 3)$

 {1.000000000     4.000000000     
 }
(%i2) tcl_output ([1, 2, 3, 4, 5, 6], 2, 3)$

 {2.000000000     5.000000000     
 }
(%i3) tcl_output ([3/7, 5/9, 11/13, 13/17], 1)$

 {((RAT SIMP) 3 7) ((RAT SIMP) 11 13) 
 }
(%i4) tcl_output ([x1, y1, x2, y2, x3, y3], 2)$

 {$Y1 $Y2 $Y3 
 }
(%i5) tcl_output ([[1, 2, 3], [11, 22, 33]], 1)$

 {SIMP 1.000000000     11.00000000     
 }
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>read</b><i> (<var>expr_1</var>, ..., <var>expr_n</var>)</i>
<a name="IDX314"></a>
</dt>
<dd><p>Prints <var>expr_1</var>, ..., <var>expr_n</var>, then reads one expression from the console
and returns the evaluated expression.
The expression is terminated with a semicolon <code>;</code> or dollar sign <code>$</code>.
</p>
<p>See also <code>readonly</code>.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) foo: 42$ 
(%i2) foo: read (&quot;foo is&quot;, foo, &quot; -- enter new value.&quot;)$
foo is 42  -- enter new value. 
(a+b)^3;
(%i3) foo;
                                     3
(%o3)                         (b + a)
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>readonly</b><i> (<var>expr_1</var>, ..., <var>expr_n</var>)</i>
<a name="IDX315"></a>
</dt>
<dd><p>Prints <var>expr_1</var>, ..., <var>expr_n</var>, then reads one expression from the console
and returns the expression (without evaluation).
The expression is terminated with a <code>;</code> (semicolon) or <code>$</code> (dollar sign).
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) aa: 7$
(%i2) foo: readonly (&quot;Enter an expression:&quot;);
Enter an expression: 
2^aa;
                                  aa
(%o2)                            2
(%i3) foo: read (&quot;Enter an expression:&quot;);
Enter an expression: 
2^aa;
(%o3)                            128
</pre></td></tr></table>
<p>See also <code>read</code>.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>reveal</b><i> (<var>expr</var>, <var>depth</var>)</i>
<a name="IDX316"></a>
</dt>
<dd><p>Replaces parts of <var>expr</var> at the specified integer <var>depth</var>
with descriptive summaries.
</p>
<ul>
<li>
Sums and differences are replaced by <code>sum(<var>n</var>)</code>
where <var>n</var> is the number of operands of the sum.
</li><li>
Products are replaced by <code>product(<var>n</var>)</code>
where <var>n</var> is the number of operands of the product.
</li><li>
Exponentials are replaced by <code>expt</code>. 
</li><li>
Quotients are replaced by <code>quotient</code>.
</li><li>
Unary negation is replaced by <code>negterm</code>.
</li></ul>

<p>When <var>depth</var> is greater than or equal to the maximum depth of <var>expr</var>,
<code>reveal (<var>expr</var>, <var>depth</var>)</code> returns <var>expr</var> unmodified.
</p>
<p><code>reveal</code> evaluates its arguments.
<code>reveal</code> returns the summarized expression.
</p>
<p>Example:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) e: expand ((a - b)^2)/expand ((exp(a) + exp(b))^2);
                          2            2
                         b  - 2 a b + a
(%o1)               -------------------------
                        b + a     2 b     2 a
                    2 %e      + %e    + %e
(%i2) reveal (e, 1);
(%o2)                       quotient
(%i3) reveal (e, 2);
                             sum(3)
(%o3)                        ------
                             sum(3)
(%i4) reveal (e, 3);
                     expt + negterm + expt
(%o4)               ------------------------
                    product(2) + expt + expt
(%i5) reveal (e, 4);
                       2                 2
                      b  - product(3) + a
(%o5)         ------------------------------------
                         product(2)     product(2)
              2 expt + %e           + %e
(%i6) reveal (e, 5);
                         2            2
                        b  - 2 a b + a
(%o6)              --------------------------
                       sum(2)     2 b     2 a
                   2 %e       + %e    + %e
(%i7) reveal (e, 6);
                          2            2
                         b  - 2 a b + a
(%o7)               -------------------------
                        b + a     2 b     2 a
                    2 %e      + %e    + %e
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>rmxchar</b>
<a name="IDX317"></a>
</dt>
<dd><p>Default value: <code>]</code>
</p>
<p><code>rmxchar</code> is the character drawn on the right-hand side of a matrix.
</p>
<p>See also <code>lmxchar</code>.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>save</b><i> (<var>filename</var>, <var>name_1</var>, <var>name_2</var>, <var>name_3</var>, ...)</i>
<a name="IDX318"></a>
</dt>
<dt><u>Function:</u> <b>save</b><i> (<var>filename</var>, values, functions, labels, ...)</i>
<a name="IDX319"></a>
</dt>
<dt><u>Function:</u> <b>save</b><i> (<var>filename</var>, [<var>m</var>, <var>n</var>])</i>
<a name="IDX320"></a>
</dt>
<dt><u>Function:</u> <b>save</b><i> (<var>filename</var>, <var>name_1</var>=<var>expr_1</var>, ...)</i>
<a name="IDX321"></a>
</dt>
<dt><u>Function:</u> <b>save</b><i> (<var>filename</var>, all)</i>
<a name="IDX322"></a>
</dt>
<dd><p>Stores the current values of <var>name_1</var>, <var>name_2</var>, <var>name_3</var>, ..., in <var>filename</var>.
The arguments are the names of variables, functions, or other objects.
If a name has no value or function associated with it, it is ignored.
<code>save</code> returns <var>filename</var>.
</p>
<p><code>save</code> stores data in the form of Lisp expressions.
The data stored by <code>save</code> may be recovered by <code>load (<var>filename</var>)</code>.
</p>
<p>The global flag <code>file_output_append</code> governs
whether <code>save</code> appends or truncates the output file.
When <code>file_output_append</code> is <code>true</code>,
<code>save</code> appends to the output file.
Otherwise, <code>save</code> truncates the output file.
In either case, <code>save</code> creates the file if it does not yet exist.
</p>
<p>The special form <code>save (<var>filename</var>, values, functions, labels, ...)</code>
stores the items named by <code>values</code>, <code>functions</code>, <code>labels</code>, etc.
The names may be any specified by the variable <code>infolists</code>.
<code>values</code> comprises all user-defined variables.
</p>
<p>The special form <code>save (<var>filename</var>, [<var>m</var>, <var>n</var>])</code> stores the values of
input and output labels <var>m</var> through <var>n</var>.
Note that <var>m</var> and <var>n</var> must be literal integers.
Input and output labels may also be stored one by one, e.g., <code>save (&quot;foo.1&quot;, %i42, %o42)</code>.
<code>save (<var>filename</var>, labels)</code> stores all input and output labels.
When the stored labels are recovered, they clobber existing labels.
</p>
<p>The special form <code>save (<var>filename</var>, <var>name_1</var>=<var>expr_1</var>, <var>name_2</var>=<var>expr_2</var>, ...)</code>
stores the values of <var>expr_1</var>, <var>expr_2</var>, ...,
with names <var>name_1</var>, <var>name_2</var>, ....
It is useful to apply this form to input and output labels, e.g., <code>save (&quot;foo.1&quot;, aa=%o88)</code>.
The right-hand side of the equality in this form may be any expression, which is evaluated.
This form does not introduce the new names into the current Maxima environment,
but only stores them in <var>filename</var>.
</p>
<p>These special forms and the general form of <code>save</code> may be mixed at will.
For example, <code>save (<var>filename</var>, aa, bb, cc=42, functions, [11, 17])</code>.
</p>
<p>The special form <code>save (<var>filename</var>, all)</code> stores the current state of Maxima.
This includes all user-defined variables, functions, arrays, etc., as well
as some automatically defined items.
The saved items include system variables,
such as <code>file_search_maxima</code> or <code>showtime</code>, if they have been assigned new values by the user;
see <code>myoptions</code>.
</p>
<p><code>save</code> quotes its arguments. 
<var>filename</var> must be a string, not a string variable.
The first and last labels to save, if specified, must be integers.
The quote-quote operator <code>''</code> evaluates a string variable to its string value,
e.g., <code>s: &quot;foo.1&quot;$ save (''s, all)$</code>,
and integer variables to their integer values, e.g., <code>m: 5$ n: 12$ save (&quot;foo.1&quot;, [''m, ''n])$</code>.
</p>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>savedef</b>
<a name="IDX323"></a>
</dt>
<dd><p>Default value: <code>true</code>
</p>
<p>When <code>savedef</code> is <code>true</code>, the Maxima version of a
user function is preserved when the function is translated.
This permits the definition to be displayed by <code>dispfun</code> and allows the function to
be edited.
</p>
<p>When <code>savedef</code> is <code>false</code>, the names of translated functions are
removed from the <code>functions</code> list.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>show</b><i> (<var>expr</var>)</i>
<a name="IDX324"></a>
</dt>
<dd><p>Displays <code>expr</code> with the indexed objects in it shown
having covariant indices as subscripts, contravariant indices as
superscripts.  The derivative indices are displayed as subscripts,
separated from the covariant indices by a comma.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>showratvars</b><i> (<var>expr</var>)</i>
<a name="IDX325"></a>
</dt>
<dd><p>Returns a list of the canonical rational expression (CRE) variables in expression <code>expr</code>.
</p>
<p>See also <code>ratvars</code>.
</p>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>stardisp</b>
<a name="IDX326"></a>
</dt>
<dd><p>Default value: <code>false</code>
</p>
<p>When <code>stardisp</code> is <code>true</code>, multiplication is
displayed with an asterisk <code>*</code> between operands.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>string</b><i> (<var>expr</var>)</i>
<a name="IDX327"></a>
</dt>
<dd><p>Converts <code>expr</code> to Maxima's linear notation
just as if it had been typed in.
</p>
<p>The return value of <code>string</code> is a string,
and thus it cannot be used in a computation.
</p>
</dd></dl>

<dl>
<dt><u>Lisp variable:</u> <b>stringdisp</b>
<a name="IDX328"></a>
</dt>
<dd><p>Default value: <code>false</code>
</p>
<p>When <code>?stringdisp</code> is <code>true</code>,
strings are displayed enclosed in double quote marks.
Otherwise,
quote marks are not displayed.
</p>
<p><code>?stringdisp</code> is always <code>true</code> when displaying a function definition.
</p>
<p><code>?stringdisp</code> is a Lisp variable,
so it must be written with a leading question mark <code>?</code>.
</p>
<p>Examples:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) ?stringdisp: false$
(%i2) &quot;This is an example string.&quot;;
(%o2)              This is an example string.
(%i3) foo () := print (&quot;This is a string in a function definition.&quot;);
(%o3) foo() := 
              print(&quot;This is a string in a function definition.&quot;)
(%i4) ?stringdisp: true$
(%i5) &quot;This is an example string.&quot;;
(%o5)             &quot;This is an example string.&quot;
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>stringout</b><i> (<var>filename</var>, <var>expr_1</var>, <var>expr_2</var>, <var>expr_3</var>, ...)</i>
<a name="IDX329"></a>
</dt>
<dt><u>Function:</u> <b>stringout</b><i> (<var>filename</var>, [<var>m</var>, <var>n</var>])</i>
<a name="IDX330"></a>
</dt>
<dt><u>Function:</u> <b>stringout</b><i> (<var>filename</var>, input)</i>
<a name="IDX331"></a>
</dt>
<dt><u>Function:</u> <b>stringout</b><i> (<var>filename</var>, functions)</i>
<a name="IDX332"></a>
</dt>
<dt><u>Function:</u> <b>stringout</b><i> (<var>filename</var>, values)</i>
<a name="IDX333"></a>
</dt>
<dd><p><code>stringout</code> writes expressions to a file in the same form the
expressions would be typed for input. The file can then be used
as input for the <code>batch</code> or <code>demo</code> commands, and it may be edited for
any purpose. <code>stringout</code> can be executed while <code>writefile</code> is in progress.
</p>
<p>The global flag <code>file_output_append</code> governs
whether <code>stringout</code> appends or truncates the output file.
When <code>file_output_append</code> is <code>true</code>,
<code>stringout</code> appends to the output file.
Otherwise, <code>stringout</code> truncates the output file.
In either case, <code>stringout</code> creates the file if it does not yet exist.
</p>
<p>The general form of <code>stringout</code> writes the values of one or more 
expressions to the output file. Note that if an expression is a
variable, only the value of the variable is written and not the name
of the variable. As a useful special case, the expressions may be
input labels (<code>%i1</code>, <code>%i2</code>, <code>%i3</code>, ...) or output labels (<code>%o1</code>, <code>%o2</code>, <code>%o3</code>, ...).
</p>
<p>If <code>grind</code> is <code>true</code>, <code>stringout</code> formats the output using the <code>grind</code>
format. Otherwise the <code>string</code> format is used. See <code>grind</code> and <code>string</code>.
</p>
<p>The special form <code>stringout (<var>filename</var>, [<var>m</var>, <var>n</var>])</code> writes the
values of input labels m through n, inclusive. 
</p>
<p>The special form <code>stringout (<var>filename</var>, input)</code> writes all
input labels to the file.
</p>
<p>The special form <code>stringout (<var>filename</var>, functions)</code> writes all
user-defined functions (named by the global list <code>functions</code>) to the file.
</p>
<p>The special form <code>stringout (<var>filename</var>, values)</code> writes all
user-assigned variables (named by the global list <code>values</code>)
to the file. Each variable is printed as an
assignment statement, with the name of the variable, a colon, and its
value. Note that the general form of <code>stringout</code> does not print 
variables as assignment statements.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>tex</b><i> (<var>expr</var>)</i>
<a name="IDX334"></a>
</dt>
<dt><u>Function:</u> <b>tex</b><i> (<var>label</var>)</i>
<a name="IDX335"></a>
</dt>
<dt><u>Function:</u> <b>tex</b><i> (<var>expr</var>, <var>filename</var>)</i>
<a name="IDX336"></a>
</dt>
<dt><u>Function:</u> <b>tex</b><i> (<var>label</var>, <var>filename</var>)</i>
<a name="IDX337"></a>
</dt>
<dd><p>Prints a representation of an expression
suitable for the TeX document preparation system.
The result is a fragment of a document,
which can be copied into a larger document
but not processed by itself.
</p>
<p><code>tex (<var>expr</var>)</code> prints a TeX representation of <var>expr</var> on the console.
</p>
<p><code>tex (<var>label</var>)</code> prints a TeX representation of the expression named by <var>label</var>
and assigns it an equation label (to be displayed to the left of the expression).
The TeX equation label is the same as the Maxima label.
</p>
<p><code>tex (<var>expr</var>, <var>filename</var>)</code> appends a TeX representation of <var>expr</var>
to the file <var>filename</var>.
<code>tex</code> quotes the <var>filename</var> argument; quote-quote <code>''</code> forces evaluation of the argument.
</p>
<p><code>tex (<var>label</var>, <var>filename</var>)</code> appends a TeX representation of the
expression named by <var>label</var>, with an equation label, to the file <var>filename</var>.
<code>tex</code> quotes the <var>filename</var> argument; quote-quote <code>''</code> forces evaluation of the argument.
</p>
<p><code>tex</code> evaluates its argument after testing it to see if it is a label.
Quote-quote <code>''</code> forces evaluation of the argument, thereby defeating the test
and preventing the label.
</p>
<p>See also <code>texput</code>.
</p>
<p>Examples:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) integrate (1/(1+x^3), x);
                                    2 x - 1
                  2            atan(-------)
             log(x  - x + 1)        sqrt(3)    log(x + 1)
(%o1)      - --------------- + ------------- + ----------
                    6             sqrt(3)          3
(%i2) tex (%o1);
$$-{{\log \left(x^2-x+1\right)}\over{6}}+{{\arctan \left({{2\,x-1
 }\over{\sqrt{3}}}\right)}\over{\sqrt{3}}}+{{\log \left(x+1\right)
 }\over{3}}\leqno{\tt (\%o1)}$$
(%o2)                          (\%o1)
(%i3) tex (integrate (sin(x), x));
$$-\cos x$$
(%o3)                           false
(%i4) tex (%o1, &quot;foo.tex&quot;);
(%o4)                          (\%o1)
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>texput</b><i> (<var>a</var>, <var>s</var>)</i>
<a name="IDX338"></a>
</dt>
<dt><u>Function:</u> <b>texput</b><i> (<var>a</var>, <var>s</var>, <var>operator_type</var>)</i>
<a name="IDX339"></a>
</dt>
<dt><u>Function:</u> <b>texput</b><i> (<var>a</var>, [<var>s_1</var>, <var>s_2</var>], matchfix)</i>
<a name="IDX340"></a>
</dt>
<dt><u>Function:</u> <b>texput</b><i> (<var>a</var>, [<var>s_1</var>, <var>s_2</var>, <var>s_3</var>], matchfix)</i>
<a name="IDX341"></a>
</dt>
<dd><p>Set the TeX output for the atom <var>a</var>,
which can be a symbol or the name of an operator.
</p>
<p><code>texput (<var>a</var>, <var>s</var>)</code> causes the <code>tex</code> function
to interpolate the string <var>s</var> into the TeX output in place of <var>a</var>.
</p>
<p><code>texput (<var>a</var>, <var>s</var>, <var>operator_type</var>)</code>,
where <var>operator_type</var> is <code>prefix</code>, <code>infix</code>, or <code>postfix</code>
causes the <code>tex</code> function to interpolate <var>s</var> into the TeX output in place of <var>a</var>,
and to place the interpolated text in the appropriate position.
</p>
<p><code>texput (<var>a</var>, [<var>s_1</var>, <var>s_2</var>], matchfix)</code>
causes the <code>tex</code> function to interpolate <var>s_1</var> and <var>s_2</var> into the TeX output
on either side of the arguments of <var>a</var>.
The arguments (if more than one) are separated by commas.
</p>
<p><code>texput (<var>a</var>, [<var>s_1</var>, <var>s_2</var>, <var>s_3</var>], matchfix)</code>
causes the <code>tex</code> function to interpolate <var>s_1</var> and <var>s_2</var> into the TeX output
on either side of the arguments of <var>a</var>,
with <var>s_3</var> separating the arguments.
</p>
<p>Examples:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) texput (me,&quot;\\mu_e&quot;);
(%o1)                         \mu_e
(%i2) tex (me);
$$\mu_e$$
(%o2)                         false
(%i3) texput (lcm, &quot;\\mathrm{lcm}&quot;);
(%o3)                     \mathrm{lcm}
(%i4) tex (lcm (a, b));
$$\mathrm{lcm}\left(a , b\right)$$
(%o4)                         false
(%i5) prefix (&quot;grad&quot;);
(%o5)                         grad
(%i6) texput (&quot;grad&quot;, &quot; \\nabla &quot;, prefix);
(%o6)                          180
(%i7) tex (grad f);
$$ \nabla f$$
(%o7)                         false
(%i8) infix (&quot;~&quot;);
(%o8)                           ~
(%i9) texput (&quot;~&quot;, &quot; \\times &quot;, infix);
(%o9)                          180
(%i10) tex (a ~ b);
$$a \times b$$
(%o10)                        false
(%i11) postfix (&quot;@&quot;);
(%o11)                          @
(%i12) texput (&quot;@&quot;, &quot;!!&quot;, postfix);
(%o12)                         160
(%i13) tex (x @);
$$x!!$$
(%o13)                        false
(%i14) matchfix (&quot;&lt;&lt;&quot;, &quot;&gt;&gt;&quot;);
(%o14)                         &lt;&lt;
(%i15) texput (&quot;&lt;&lt;&quot;, [&quot; \\langle &quot;, &quot; \\rangle &quot;], matchfix);
(%o15)              \langle ( \rangle , false)
(%i16) tex (&lt;&lt;a&gt;&gt;);
$$ \langle a \rangle $$
(%o16)                        false
(%i17) tex (&lt;&lt;a, b&gt;&gt;);
$$ \langle a , b \rangle $$
(%o17)                        false
(%i18) texput (&quot;&lt;&lt;&quot;, [&quot; \\langle &quot;, &quot; \\rangle &quot;, &quot; \\, | \\,&quot;], matchfix);
(%o18)            \langle ( \rangle ,  \, | \,)
(%i19) tex (&lt;&lt;a&gt;&gt;);
$$ \langle a \rangle $$
(%o19)                        false
(%i20) tex (&lt;&lt;a, b&gt;&gt;);
$$ \langle a \, | \,b \rangle $$
(%o20)                        false
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>system</b><i> (<var>command</var>)</i>
<a name="IDX342"></a>
</dt>
<dd><p>Executes <var>command</var> as a separate process.
The command is passed to the default shell for execution.
<code>system</code> is not supported by all operating
systems, but generally exists in Unix and Unix-like environments.
</p>
<p>Supposing <code>_hist.out</code>
is a list of frequencies which you wish to plot as a bar graph
using <code>xgraph</code>. 
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) (with_stdout(&quot;_hist.out&quot;,
           for i:1 thru length(hist) do (
             print(i,hist[i]))),
       system(&quot;xgraph -bar -brw .7 -nl &lt; _hist.out&quot;));
</pre></td></tr></table>
<p>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:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">system(&quot;(xgraph -bar -brw .7 -nl &lt; _hist.out;  rm -f _hist.out)&amp;&quot;)
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>ttyoff</b>
<a name="IDX343"></a>
</dt>
<dd><p>Default value: <code>false</code>
</p>
<p>When <code>ttyoff</code> is <code>true</code>, output expressions are not displayed.
Output expressions are still computed and assigned labels. See <code>labels</code>.
</p>
<p>Text printed by built-in Maxima functions, such as error messages and the output of <code>describe</code>,
is not affected by <code>ttyoff</code>.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>with_stdout</b><i> (<var>filename</var>, <var>expr_1</var>, <var>expr_2</var>, <var>expr_3</var>, ...)</i>
<a name="IDX344"></a>
</dt>
<dd><p>Opens <var>filename</var> and then evaluates <var>expr_1</var>, <var>expr_2</var>, <var>expr_3</var>, ....
The values of the arguments are not stored in <var>filename</var>,
but any printed output generated by evaluating the arguments
(from <code>print</code>, <code>display</code>, <code>disp</code>, or <code>grind</code>, for example)
goes to <var>filename</var> instead of the console.
</p>
<p>The global flag <code>file_output_append</code> governs
whether <code>with_stdout</code> appends or truncates the output file.
When <code>file_output_append</code> is <code>true</code>,
<code>with_stdout</code> appends to the output file.
Otherwise, <code>with_stdout</code> truncates the output file.
In either case, <code>with_stdout</code> creates the file if it does not yet exist.
</p>
<p><code>with_stdout</code> returns the value of its final argument.
</p>
<p>See also <code>writefile</code>.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) with_stdout (&quot;tmp.out&quot;, for i:5 thru 10 do print (i, &quot;! yields&quot;, i!))$
(%i2) printfile (&quot;tmp.out&quot;)$
5 ! yields 120 
6 ! yields 720 
7 ! yields 5040 
8 ! yields 40320 
9 ! yields 362880 
10 ! yields 3628800
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>writefile</b><i> (<var>filename</var>)</i>
<a name="IDX345"></a>
</dt>
<dd><p>Begins writing a transcript of the Maxima session to <var>filename</var>.
All interaction between the user and Maxima is then recorded in this file,
just as it appears on the console.
</p>
<p>As the transcript is printed in the console output format,
it cannot be reloaded into Maxima.
To make a file containing expressions which can be reloaded,
see <code>save</code> and <code>stringout</code>.
<code>save</code> stores expressions in Lisp form, while <code>stringout</code> stores expressions in Maxima form.
</p>
<p>The effect of executing <code>writefile</code> when <var>filename</var> already exists
depends on the underlying Lisp implementation;
the transcript file may be clobbered, or the file may be appended.
<code>appendfile</code> always appends to the transcript file.
</p>
<p>It may be convenient to execute <code>playback</code> after
<code>writefile</code> to save the display of previous interactions.
As <code>playback</code> displays only the input and output variables (<code>%i1</code>, <code>%o1</code>, etc.),
any output generated by a print statement in a function 
(as opposed to a return value) is not displayed by <code>playback</code>.
</p>
<p><code>closefile</code> closes the transcript file opened by <code>writefile</code> or <code>appendfile</code>.
</p>
</dd></dl>

<hr size="6">
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC35" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="maxima_10.html#SEC40" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<p>
 <font size="-1">
  This document was generated by <em>Robert Dodier</em> on <em>September, 20 2006</em> using <a href="http://texi2html.cvshome.org/"><em>texi2html 1.76</em></a>.
 </font>
 <br>

</p>
</body>
</html>