forked from jhbadger/xlispstat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxlisp.hlp
3962 lines (3866 loc) · 144 KB
/
xlisp.hlp
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
;; system variables
(*OBARRAY* VARIABLE) "The object hash table"
(*STANDARD-INPUT* VARIABLE) "Default input stream."
(*STANDARD-OUTPUT* VARIABLE) "Default output stream."
(*ERROR-OUTPUT* VARIABLE) "Default error output stream."
(*DEBUG-IO* VARIABLE) "Default break input/output stream."
(*TRACE-OUTPUT* VARIABLE) "Default trace output stream."
(*EVALHOOK* VARIABLE)
"If *EVALHOOK* is not NIL, its value must be a function of two arguments:
a form to evaluate and an environment. This function does the evaluation
instead of EVAL."
(*APPLYHOOK* VARIABLE)
"Used to substitute another function for the implicit APPLY normally
done within EVAL. If *APPLYHOOK* is not NIL, its value must be a
function of two arguments: a function to be applied and a list of
arguments. This function does the application instead of APPLY."
(*TRACELIST* VARIABLE) "List of names of functions and macros to be traced"
(*TRACENABLE* VARIABLE) "Enable backtrace on errors"
(*TRACELIMIT* VARIABLE) "Number of levels of trace back information"
(*BREAKENABLE* VARIABLE) "Enter the break loop on errors?"
(*READTABLE* VARIABLE) "The current readtable."
(*GC-FLAG* VARIABLE) "Controls printing of GC messages"
(*GC-HOOK* VARIABLE) "If not nil, function of two arguments to be called after GC"
(*PRINT-CASE* VARIABLE) "symbol output case (:upcase or :downcase)"
(*RANDOM-STATE* VARIABLE) "Current state of the random number generator"
(*INPUT-STREAM* VARIABLE) "Stream used for buffering between listener and reader."
(PI VARIABLE)
"The floating-point number that is approximately equal to the ratio of the
circumference of a circle to its diameter."
(- VARIABLE) "The current input expression"
(+ VARIABLE) "The last expression read"
(++ VARIABLE) "The previous value of +"
(+++ VARIABLE) "The previous value of ++"
(* VARIABLE) "The result of the last evaluation"
(** VARIABLE) "The previous value of *"
(*** VARIABLE) "The previous value of **"
(*DEFAULT-PATH* VARIABLE) "Default path for require"
(*FEATURES* VARIABLE)
"List of symbols that name features of the current version of XLISP-STAT."
(*MODULES* VARIABLE)
"list of names of the modules that have been loaded."
(*PACKAGE* VARIABLE)
"The current package."
(*PRINT-ARRAY* VARIABLE)
"Print array elements?"
(*PRINT-CIRCLE* VARIABLE)
"Print circular structures readably?"
(*PRINT-ESCAPE* VARIABLE)
"Print escape characters when appropriate?"
(*PRINT-GENSYM* VARIABLE)
"Print uninterned symbols with #:?"
(*PRINT-LENGTH* VARIABLE)
"Number of elements to print at each level. Unlimited if NIL."
(*PRINT-LEVEL* VARIABLE)
"Number of levels to print. Unlimited if NIL."
(*READ-SUPPRESS* VARIABLE)
"Suppress reader interpretation of read expressions?"
(*TERMINAL-IO* VARIABLE)
"The terminal I/O stream."
(INTERNAL-TIME-UNITS-PER-SECOND VARIABLE)
"The number of internal time units that fit into a second."
(LAMBDA-LIST-KEYWORDS VARIABLE)
"List of all the lambda-list keywords."
(NIL VARIABLE)
"Holds NIL."
(T VARIABLE)
"Holds T."
;; Built in types
(SUBR TYPE) "Built in function"
(FSUBR TYPE) "Built in special form or macro"
(CONS TYPE) "A list cell"
(SYMBOL TYPE) "A symbol"
(FIXNUM TYPE) "An integer"
(FLONUM TYPE) "A floating point number"
(STRING TYPE) "A string"
(OBJECT TYPE) "An xlisp object"
(FILE-STREAM TYPE) "A file stream"
(VECTOR TYPE) "A vector"
(CLOSURE TYPE) "A function closure or macro"
(CHARACTER TYPE) "A character"
(UNNAMED-STREAM TYPE) "An unnamed stream (string input stream, e. g.)"
(COMPLEX TYPE) "A complex number"
(ARRAY TYPE) "A displaced multidimensional array"
;; built in object prototypes
(*OBJECT* VARIABLE) "The top of the object hierarchy."
(HARDWARE-OBJECT-PROTO VARIABLE) "Internally allocatable object prototype"
(WINDOW-PROTO VARIABLE) "Window prototype"
(EDIT-WINDOW-PROTO VARIABLE) "Edit window prototype"
(LISTENER-PROTO VARIABLE) "Listener window prototype"
(MENU-PROTO VARIABLE) "Menu prototype"
(APPLE-MENU-PROTO VARIABLE) "Apple menu prototype"
(MENU-ITEM-PROTO VARIABLE) "Menu item prototype"
(DIALOG-PROTO VARIABLE) "Dialog prototype"
(DIALOG-ITEM-PROTO VARIABLE) "Dialog item prototype"
(BUTTON-ITEM-PROTO VARIABLE) "Dialog button prototype"
(TOGGLE-ITEM-PROTO VARIABLE) "Dialog toggle item (check box) prototype"
(TEXT-ITEM-PROTO VARIABLE) "Dialog text item prototype (editable or static)"
(CHOICE-ITEM-PROTO VARIABLE) "Dialog choice item (radio button cluster) prototype"
(SCROLL-ITEM-PROTO VARIABLE) "Dialog scroll bar prototype"
(LIST-ITEM-PROTO VARIABLE) "Dialog list item prototype"
(GRAPH-WINDOW-PROTO VARIABLE) "Graphics window prototype"
(GRAPH-PROTO VARIABLE) "Dynamic plot prototype"
(SPIN-PROTO VARIABLE) "Rotating plot prototype"
(SCATMAT-PROTO VARIABLE) "Scatterplot matrix prototype"
(NAME-LIST-PROTO VARIABLE) "Name list prototype"
(HISTOGRAM-PROTO VARIABLE) "Histogram prototype"
(SCATTERPLOT-PROTO VARIABLE) "Scatterplot prototype"
(COMPOUND-DATA-PROTO VARIABLE) "Compound data object prototype"
;; evaluator functions
EVAL
"Args: (expr)
Evaluates EXPR in a NULL environment and returns the result."
APPLY
"Args: (function &rest args)
Conses all arguments but the last onto the last and applies FUNCTION to
the resulting argument list. Last argument must be a list."
FUNCALL
"Args: (function &rest arguments)
Applies FUNCTION to the ARGUMENTs"
QUOTE
"Syntax: (quote x)
Returns X without evaluating it. ALso 'x."
FUNCTION
"Syntax: (function x)
If X is a lambda expression, creates and returns a lexical closure of X in
the current lexical environment. If X is a symbol that names a function,
returns that function. ALso #'x."
BACKQUOTE
"Syntax: (backquote template) or `template.
Fills in TEMPLATE by expanding COMMA and COMMA-AT expressions."
LAMBDA
"Syntax: (lambda args {forms}*)
Makes a function closure."
;; symbol functions
SET
"Args: (symbol value)
Assigns the value of VALUE to the dynamic variable named by SYMBOL (i. e.
it changes the global definition of SYMBOL), and returns the value assigned."
SETQ
"Syntax: (setq {var form}*)
VARs are not evaluated and must be symbols. Assigns the value of the first
FORM to the first VAR, then assigns the value of the second FORM to the second
VAR, and so on. Returns the last value assigned."
SETF
"Syntax: (setf {place newvalue}*)
Replaces the value in PLACE with the value of NEWVALUE, from left to right.
Returns the value of the last NEWVALUE. Each PLACE may be any one of the
following:
* A symbol that names a variable.
* A function call form whose first element is the name of the following
functions:
nth
aref subarray sublist select elt
get
symbol-value
symbol-plist
documentation
slot-value
c?r c??r c???r c????r
where '?' stands for either 'a' or 'd'."
DEFUN
"Syntax: (defun name lambda-list [doc] {form}*)
Defines a function as the global definition of the symbol NAME. The
complete syntax of a lambda-list is:
({var}*
[&optional {var}*]
[&rest var]
[&aux {var}*])
The doc-string DOC, if supplied, is saved as a FUNCTION doc and can be
retrieved by (documentation 'NAME 'function)."
DEFMACRO
"Syntax: (defmacro name defmacro-lambda-list [doc] {form}*)
Defines a macro as the global definition of the symbol NAME. The complete
syntax of a lambda-list is:
({var}*
[&optional {var}*]
[&rest var]
[&aux {var}*])
The doc-string DOC, if supplied, is saved as a FUNCTION doc and can be
retrieved by (documentation 'NAME 'function)."
GENSYM
"Args: (&optional (x nil))
Creates and returns a new uninterned symbol whose name is a prefix string
(defaults to \"G\"), followed by a decimal number. The number is incremented
by each call to GENSYM. X, if an integer, resets the counter. If X is a
string, it becomes the new prefix."
MAKE-SYMBOL
"Args: (string)
Create and return new uninterned symbol with print name STRING."
INTERN
"Args: (name)
Returns a symbol having the specified name, creating it if necessary."
SYMBOL-NAME
"Args: (symbol)
Returns the print name of the symbol SYMBOL."
SYMBOL-VALUE
"Args: (symbol)
Returns the current global value of the variable named by SYMBOL."
SYMBOL-FUNCTION
"Args: (symbol)
Returns the current global function definition of the function named by SYMBOL."
SYMBOL-PLIST
"Args: (symbol)
Returns the property list of SYMBOL."
GET
"Args: (symbol indicator)
Looks on the property list of SYMBOL for the specified INDICATOR. If this
is found, returns the associated value. Otherwise, returns nil."
GETF
"Args: (place indicator &optional default)
Returns property value of INDICATOR in PLACE, or DEFAULT if not found."
PUTPROP
"Args: (symbol value indicator)
Puts property INDICATOR with value VALUE on the property list of SYMBOL.
Returns VALUE."
REMPROP
"Args: (symbol indicator)
Look on property list of SYMBOL for property with specified
INDICATOR. If found, splice this indicator and its value out of
the plist, and return the tail of the original list starting with
INDICATOR. If not found, returns NIL with no side effects.
(This is what it should return. Actually always returns nil. ***BUG***)"
HASH
" Args (sym n)
Computes the hash index for symbol SYM in a table of size N."
;; list functions
CAR
"Args: (list)
Returns the car of LIST. Returns NIL if LIST is NIL."
CDR
"Args: (list)
Returns the cdr of LIST. Returns NIL if LIST is NIL."
CAAAAR
"Args: (x)
Equivalent to (CAR (CAR (CAR (CAR X))))."
CAAADR
"Args: (x)
Equivalent to (CAR (CAR (CAR (CDR X))))."
CAAAR
"Args: (x)
Equivalent to (CAR (CAR (CAR X)))."
CAADAR
"Args: (x)
Equivalent to (CAR (CAR (CDR (CAR X))))."
CAADDR
"Args: (x)
Equivalent to (CAR (CAR (CDR (CDR X))))."
CAADR
"Args: (x)
Equivalent to (CAR (CAR (CDR X)))."
CAAR
"Args: (x)
Equivalent to (CAR (CAR X))."
CADAAR
"Args: (x)
Equivalent to (CAR (CDR (CAR (CAR X))))."
CADADR
"Args: (x)
Equivalent to (CAR (CDR (CAR (CDR X))))."
CADAR
"Args: (x)
Equivalent to (CAR (CDR (CAR X)))."
CADDAR
"Args: (x)
Equivalent to (CAR (CDR (CDR (CAR X))))."
CADDDR
"Args: (x)
Equivalent to (CAR (CDR (CDR (CDR X))))."
CADDR
"Args: (x)
Equivalent to (CAR (CDR (CDR X)))."
CADR
"Args: (x)
Equivalent to (CAR (CDR X))."
CDAADR
"Args: (x)
Equivalent to (CDR (CAR (CAR (CDR X))))."
CDAAR
"Args: (x)
Equivalent to (CDR (CAR (CAR X)))."
CDADAR
"Args: (x)
Equivalent to (CDR (CAR (CDR (CAR X))))."
CDADDR
"Args: (x)
Equivalent to (CDR (CAR (CDR (CDR X))))."
CDADR
"Args: (x)
Equivalent to (CDR (CAR (CDR X)))."
CDAR
"Args: (x)
Equivalent to (CDR (CAR X))."
CDDAAR
"Args: (x)
Equivalent to (CDR (CDR (CAR (CAR X))))."
CDDADR
"Args: (x)
Equivalent to (CDR (CDR (CAR (CDR X))))."
CDDAR
"Args: (x)
Equivalent to (CDR (CDR (CAR X)))."
CDDDAR
"Args: (x)
Equivalent to (CDR (CDR (CDR (CAR X))))."
CDDDDR
"Args: (x)
Equivalent to (CDR (CDR (CDR (CDR X))))."
CDDDR
"Args: (x)
Equivalent to (CDR (CDR (CDR X)))."
CDDR
"Args: (x)
Equivalent to (CDR (CDR X))."
CDAAAR
"Args: (x)
Equivalent to (CDR (CAR (CAR (CAR X))))."
FIRST
"Args: (x)
Equivalent to (CAR X)."
SECOND
"Args: (x)
Equivalent to (CAR (CDR X))."
THIRD
"Args: (x)
Equivalent to (CADDR X)."
FOURTH
"Args: (x)
Equivalent to (CADDDR X)."
REST
"Args: (x)
Equivalent to (CDR X)."
CONS
"Args: (x y)
Returns a new cons (list node) whose car and cdr are X and Y, respectively."
LIST
"Args: (&rest args)
Returns a list of its arguments"
APPEND
"Args: (&rest lists)
Constructs a new list by concatenating its arguments."
REVERSE
"Args: (list)
Returns a new list containing the same elements as LIST but in
reverse order."
LAST
"Args: (list)
Returns the last cons in LIST"
NTH
"Args: (n list)
Returns the N-th element of LIST, where the car of LIST is the zero-th
element."
NTHCDR
"Args: (n list)
Returns the result of performing the CDR operation N times on LIST."
MEMBER
"Args: (item list &key (test #'eql) test-not)
Returns the tail of LIST beginning with the first ITEM."
ASSOC
"Args: (item alist &key (test #'eql) test-not)
Returns the first pair in ALIST whose car is equal (in the sense of TEST) to
ITEM."
SUBST
"Args: (new old tree &key (test #'eql) test-not)
Substitutes NEW for subtrees of TREE that match OLD."
SUBLIS
"Args: (alist tree &key (test #'eql) test-not)
Substitutes from ALIST for subtrees of TREE nondestructively."
REMOVE
"Args: (item seq &key (test #'eql) test-not (start 0) (end (length seq)))
Returns a copy of SEQ with ITEM removed."
LENGTH
"Args: (sequence)
Returns the length of SEQUENCE."
MAPC
"Args: (fun list &rest more-lists)
Applies FUN to successive cars of LISTs. Returns the first LIST."
MAPCAR
"Args: (fun list &rest more-lists)
Applies FUN to successive cars of LISTs and returns the results as a list."
MAPL
"Args: (fun list &rest more-lists)
Applies FUN to successive cdrs of LISTs. Returns the first LIST."
MAPLIST
"Args: (fun list &rest more-lists)
Applies FUN to successive cdrs of LISTs and returns the results as a list."
;; destructive list functions
RPLACA
"Args: (x y)
Replaces the car of X with Y, and returns the modified X."
RPLACD
"Args: (x y)
Replaces the cdr of X with Y, and returns the modified X."
NCONC
"Args: (&rest lists)
Concatenates LISTs by destructively modifying them."
DELETE
"Args: (item seq &key (test #'eql) test-not &key (start 0) (end (length seq)))
Returns a list formed by removing the specified ITEM destructively from
SEQ."
;; predicate functions
ATOM
"Args: (x)
Returns T if X is not a cons; NIL otherwise."
SYMBOLP
"Args: (x)
Returns T if X is a symbol; NIL otherwise."
NUMBERP
"Args: (x)
Returns T if X is any kind of number; NIL otherwise."
BOUNDP
"Args: (symbol)
Returns T if the global variable named by SYMBOL has a value; NIL otherwise."
NULL
"Args: (x)
Returns T if X is NIL; NIL otherwise."
LISTP
"Args: (x)
Returns T if X is either a cons or NIL; NIL otherwise."
CONSP
"Args: (x)
Returns T if X is a cons; NIL otherwise."
EQ
"Args: (x y)
Returns T if X and Y are the same identical object; NIL otherwise."
EQL
"Args: (x y)
Returns T if X and Y are EQ, or if they are numbers of the same type with
the same value, or if they are identical characters. Returns NIL otherwise."
EQUAL
"Args: (x y)
Returns T if X and Y are EQL or if they are of the same type and corresponding
components are EQUAL. Returns NIL otherwise. Arrays must be EQ to be EQUAL."
NOT
"Args: (x)
Returns T if X is NIL; NIL otherwise."
;; special forms
COND
"Syntax: (cond {(test {form}*)}*)
Evaluates each TEST in order until one evaluates to a non-NIL value. Then
evaluates the associated FORMs in order and returns the value of the last
FORM. If no forms follow the TEST, then returns the value of the TEST.
Returns NIL, if all TESTs evaluate to NIL."
CASE
"Syntax: (case keyform {({key | ({key}*)} {form}*)}*)
Evaluates KEYFORM and tries to find the KEY that is EQL to the value of
KEYFORM. If one is found, then evaluates FORMs that follow the KEY and
returns the value of the last FORM. If not, simply returns NIL."
AND
"Syntax: (and {form}*)
Evaluates FORMs in order from left to right. If any FORM evaluates to NIL,
returns immediately with the value NIL. Else, returns the value of the
last FORM."
OR
"Syntax: (or {form}*)
Evaluates FORMs in order from left to right. If any FORM evaluates to
non-NIL, quits and returns that value. If the last FORM is reached,
returns whatever value it returns."
LET
"Syntax: (let ({var | (var [value])}*) {form}*)
Initializes VARs, binding them to the values of VALUEs (which defaults to NIL)
all at once, then evaluates FORMs as a PROGN."
LET*
"Syntax: (let* ({var | (var [value])}*) {form}*)
Initializes VARs, binding them to the values of VALUEs (which defaults to NIL)
from left to right, then evaluates FORMs as a PROGN."
IF
"Syntax: (if test then [else])
If TEST evaluates to non-NIL, then evaluates THEN and returns the result.
If not, evaluates ELSE (which defaults to NIL) and returns the result."
PROG
"Syntax: (prog ({var | (var [init])}*) {tag | statement}*)
Binds VARs in parallel, and then executes STATEMENTs."
PROG*
"Syntax: (prog* ({var | (var [init])}*) {tag | statement}*)
Binds VARs sequentially, and then executes STATEMENTs."
PROG1
"Syntax: (prog1 first {form}*)
Evaluates FIRST and FORMs in order, and returns the value of FIRST."
PROG2
"Syntax: (prog2 first second {forms}*)
Evaluates FIRST, SECOND, and FORMs in order, and returns the value
of SECOND."
PROGN
"Syntax: (progn {form}*)
Evaluates FORMs in order, and returns whatever the last FORM returns."
PROGV
"Syntax: (progv symbols values {form}*)
Evaluates FORMs in order, with SYMBOLS dynamically bound to VALUES, and
returns whatever the last FORM returns."
GO
"Syntax: (go tag)
Jumps to the specified TAG established by a lexically surrounding PROG
construct."
RETURN
"Syntax: (return [result])
Returns from the lexically surrounding PROG construct. The value of RESULT,
which defaults to NIL, is returned as the value of the PROG construct."
DO
"Syntax: (do ({(var [init [step]])}*) (endtest {result}*) {tag | statement}*)
Creates a NIL block, binds each VAR to the value of the corresponding INIT,
and then executes STATEMENTs repeatedly until ENDTEST is satisfied. After
each iteration, assigns to each VAR the value of the corresponding STEP. When
ENDTEST is satisfied, evaluates RESULTs as a PROGN and returns the value of
the last RESULT (or NIL if no RESULTs are supplied). Performs variable
bindings and assignments all at once, just like LET does."
DO*
"Syntax: (do* ({(var [init [step]])}*) (endtest {result}*) {tag | statement}*)
Just like DO, but performs variable bindings and assignments in serial, just
like LET* and SETQ do."
DOLIST
"Syntax: (dolist (var listform [result]) {tag | statement}*)
Executes STATEMENTs, with VAR bound to each member of the list value of
LISTFORM. Then returns the value of RESULT (which defaults to NIL)."
DOTIMES
"Syntax: (dotimes (var countform [result]) {tag | statement}*)
Executes STATEMENTs, with VAR bound to each number between 0 (inclusive) and
the value of COUNTFORM (exclusive). Then returns the value of RESULT
(which defaults to NIL)."
CATCH
"Syntax: (catch tag {form}*)
Sets up a catcher with that value TAG. Then evaluates FORMs as a PROGN, but
may possibly abort the evaluation by a THROW form that specifies the value
EQ to the catcher tag."
THROW
"Syntax: (throw tag result)
Evaluates TAG and aborts the execution of the most recent CATCH form that sets
up a catcher with the same tag value. The CATCH form returns whatever RESULT
returned."
;; debugging and error handling functions
ERROR
"Args: (datum &rest args)
Signals a fatal error. if DATUM is a string, it is used as format
string with Args. If it is a symbol, it is used with ARGS so make a
condition. If DATUM is a condition, there must be no other arguments."
CERROR
"Args: (continue-message-string datum &rest args)
Signals a correctable error. Returns NIL when continued from the break loop."
CLEAN-UP
"Args: ()
Cleans up after an error and moves to next lower break loop level."
TOP-LEVEL
"Args: (&optional (print t))
Returns to the top level. Print message if PRINT is non-NIL."
CONTINUE
"Args: ()
Continues after a correctable error"
ERRSET
"Args: (expr [pflag])
Traps errors occurring during the evaluation of EXPR. PFLAG controls printing
of the error message. Returns the value of the last expression consed with
NIL or NIL. "
"Args: (number)
Prints NUMBER levels of trace back information. Returns NIL."
BAKTRACE
"Args: (&optional number (print-args *baktrace-print-args*))
Prints NUMBER levels of trace back information. Prints call arguments if
PRINT-ARGS is nto NIL. Returns NIL."
EVALHOOK
"Args: (form evalhookfn applyhookfn &optional (env nil))
Evaluates FORM with *EVALHOOK* bound to EVALHOOKFN and *APPLYHOOK* bound
to APPLYHOOKFN. Ignores these hooks once, for the top-level evaluation
of FORM.(Note: *APPPLYHOOK* is not yet implemented, and is thus ignored.)"
;; string functions
SUBSEQ
"Args: (sequence start &optional end)
Extracts and returns the subsequence of SEQUENCE starting at START and
ending at END, if supplied, or the end of SEQUENCE."
STRING
"
Args: (sym)
Returns print-name of SYM if SYM is a symbol, or SYM if SYM is a."
CHAR
"Args: (string index)
Returns the INDEX-th character in STRING."
;; I/O functions
READ
"Args: (&optional (stream *standard-input*) (eof-error-p t) (eof-value nil) (recursivep nil))
Reads and returns the next object from STREAM."
PRINT
"Args: (object &optional (stream *standard-output*))
Outputs a newline character, and then prints OBJECT in the most readable
representation. Returns OBJECT."
PRIN1
"Args: (object &optional (stream *standard-output*))
Prints OBJECT in the most readable representation. Returns OBJECT."
PRINC
"Args: (object &optional (stream *standard-output*))
Prints OBJECT without escape characters. Returns OBJECT."
TERPRI
"Args: (&optional (stream *standard-output*))
Outputs a newline character."
FLATSIZE
"Args: (object)
Returns length of printed representation of OBJECT using PRIN1"
FLATC
"Args: (object)
Returns length of printed representation of OBJECT using PRINC"
;; file I/O functions
OPEN
"Args: (fname &key (direction :input))
Opens file named by string or symbol FNAME. DIRECTION is :INPUT or :OUTPUT."
CLOSE
"Args: (stream)
Close file stream STREAM."
READ-CHAR
"Args: (&optional (stream *standard-input*) (eof-value nil) (eof-error-p t)
(recursive-p nil))
Reads a character from STREAM."
PEEK-CHAR
"Args: (&optional (peek-type nil) (stream *standard-input*)
(eof-value nil) (eof-error-p t) (recursive-p nil))
Peeks at the next character in the input stream STREAM."
WRITE-CHAR
"Args: (char &optional (stream *standard-output*))
Outputs CHAR and returns it."
READ-LINE
"Args: (&optional (stream *standard-input*) (eof-value nil) (eof-error-p t)
(recursive-p nil))
Returns line of text read from STREAM as a string without the newline
character."
;; system functions
LOAD
"Args: (filename &key (verbose t) (print nil))
Loads the file named by FILENAME into XLISP. Returns T if load succeeds,
NIL if file does not exist."
DRIBBLE
"Args: (&optional file)
If string or symbol FILE is supplied creates a transcript file with this name.
If FILE is missing closes the transcript file."
SYSTEM
"Args: (string)
Runs the operating system command specified by string. Not available on
all implementations."
DYN-LOAD
"Args: (file &key verbose libflags fortran)
Links the object file FILE with standard C libraries and loads into
the running XLISP-STAT process. If FORTRAN is not NIL also searches
standard FORTRAN libraries. LIBFLAGS can be a string used to specify
additional libraries, for example "-lcmlib". Not available on all
implementations."
CALL-CFUN
"Args: (cfun &rest args)
CFUN is a string naming a C function. The remaining arguments must be
integers, sequences of integers, reals or sequences of reals. CFUN is
called with the remaining arguments and a list of the lists of the
values of the arguments after the call is returned. Arguments in the
call will be pointers to ints or pointers to doubles. Not available
on all implementations."
CALL-FSUB
"Args: (fsub &rest args)
FSUB is a string naming a FORTRAN subroutine. The remaining arguments
must be integers, sequences of integers, reals or sequences of reals.
FSUB is called with the remaining arguments and a list of the lists of
the values of the arguments after the call is returned. Arguments in
the call will be (arrays of) integers or double precision numbers. Not
available on all implementations."
CALL-LFUN
"Args: (lfun &rest args)
LFUN is a C function written to conform to internal XLISP argument
reading and value returning conventions. Applies LFUN to ARGS and
returns the result."
GC
"Args: ()
Forces (major) garbage collection. Returns nil."
EXPAND
"Args: (number)
Expand memory by adding NUMBER segments. Returns the number of segments."
ALLOC
"Args: (number)
Changes number of nodes to allocate in each segment to NUMBER. Returns
old number of nodes to allocate."
ROOM
"Args: ()
Shows memory allocation statistics. Returns nil."
SAVE
"Args: (file)
Saves current memory image in FILE.wks. Does not work right with allocated objects."
RESTORE
"Args: (file)
Restores memory image from FILE.wks. Does not work right with allocated objects."
TYPE-OF
"Args: (x)
Returns the type of X."
EXIT
"Args: ()
Exits from XLISP."
PEEK
"Args (address)
Peek at an ADDRESS in memory."
POKE
"Args: (address value)
Poke VALUE into ADDRESS in memory."
ADDRESS-OF
"Args (x)
Get the address of an XLISP node."
X11-OPTIONS
"Args: (&key (fast-lines t) (fast-symbols t) (motion-sync t)
Sets performance options for X11 window system."
;; new functions and special forms
VECTOR
"Args: (&rest items)
Returns a vector with ITEMS as elements."
BLOCK
"Syntax: (block name {form}*)
The FORMs are evaluated in order, but it is possible to exit the block
using (RETURN-FROM name value). The RETURN-FROM must be lexically contained
within the block."
RETURN-FROM
"Syntax: (return-from name [result])
Returns from the lexically surrounding block whose name is NAME. The value
of RESULT, which defaults to NIL, is returned as the value of the block."
TAGBODY
"Syntax: (tagbody {tag | statement}*)
Executes STATEMENTs and returns NIL if it falls off the end."
PSETQ
"Syntax: (psetq {var form}*)
Similar to SETQ, but evaluates all FORMs first, and then assigns each value to
the corresponding VAR. Returns NIL always."
FLET
"Syntax: (flet ({(name lambda-list {decl | doc}* {form}*)}*) . body)
Evaluates BODY as a PROGN, with local function definitions in effect. BODY is
the scope of each local function definition. Since the scope does not include
the function definitions themselves, the local function can reference
externally defined functions of the same name. See the doc of DEFUN for the
complete syntax of a lambda-list. Doc-strings for local functions are simply
ignored."
LABELS
"Syntax: (labels ({(name lambda-list {decl | doc}* {form}*)}*) . body)
Evaluates BODY as a PROGN, with the local function definitions in effect.
The scope of the locally defined functions include the function definitions
themselves, so they can reference externally defined functions of the same
name. See the doc of DEFUN for the complete syntax of a lambda-list.
Doc-strings for local functions are simply ignored."
MACROLET
"Syntax: (macrolet ({(name defmacro-lambda-list {decl | doc}* . body)}*)
{form}*)
Evaluates FORMs as a PROGN, with the local macro definitions in effect.
See the doc of DEFMACRO for the complete syntax of a defmacro-lambda-list.
Doc-strings for local macros are simply ignored."
UNWIND-PROTECT
"Syntax: (unwind-protect protected-form {cleanup-form}*)
Evaluates PROTECTED-FORM and returns whatever it returned. Guarantees that
CLEANUP-FORMs be always evaluated before exiting from the UNWIND-PROTECT
form."
PPRINT
"Args: (object &optional (stream *standard-output*))
Pretty-prints OBJECT. Returns OBJECT."
STRING<
"Args: (string1 string2
&key (start1 0) (end1 (length string1))
(start2 0) (end2 (length string2)))
If STRING1 is lexicographically less than STRING2, then returns the longest
common prefix of the strings. Otherwise, returns NIL."
STRING<=
"Args: (string1 string2
&key (start1 0) (end1 (length string1))
(start2 0) (end2 (length string2)))
If STRING1 is lexicographically less than or equal to STRING2, then returns
the longest common prefix of the two strings. Otherwise, returns NIL."
STRING=
"Args: (string1 string2
&key (start1 0) (end1 (length string1))
(start2 0) (end2 (length string2)))
Returns T if the two strings are character-wise CHAR=; NIL otherwise."
STRING/=
"Args: (string1 string2
&key (start1 0) (end1 (length string1))
(start2 0) (end2 (length string2)))
Returns NIL if STRING1 and STRING2 are character-wise CHAR=. Otherwise,
returns the index to the longest common prefix of the strings."
STRING>=
"Args: (string1 string2
&key (start1 0) (end1 (length string1))
(start2 0) (end2 (length string2)))
If STRING1 is lexicographically greater than or equal to STRING2, then returns
the longest common prefix of the strings. Otherwise, returns NIL."
STRING>
"Args: (string1 string2
&key (start1 0) (end1 (length string1))
(start2 0) (end2 (length string2)))
If STRING1 is lexicographically greater than STRING2, then returns the
longest common prefix of the strings. Otherwise, returns NIL."
STRING-LESSP
"Args: (string1 string2
&key (start1 0) (end1 (length string1))
(start2 0) (end2 (length string2)))
Similar to STRING<, but ignores cases."
STRING-NOT-GREATERP
"Args: (string1 string2
&key (start1 0) (end1 (length string1))
(start2 0) (end2 (length string2)))
Similar to STRING<=, but ignores cases."
STRING-EQUAL
"Args: (string1 string2
&key (start1 0) (end1 (length string1))
(start2 0) (end2 (length string2)))
Given two strings (string1 and string2), and optional integers start1,
start2, end1 and end2, compares characters in string1 to characters in
string2 (using char-equal)."
STRING-NOT-EQUAL
"Args: (string1 string2
&key (start1 0) (end1 (length string1))
(start2 0) (end2 (length string2)))
Similar to STRING=, but ignores cases."
STRING-NOT-LESSP
"Args: (string1 string2
&key (start1 0) (end1 (length string1))
(start2 0) (end2 (length string2)))
Similar to STRING>=, but ignores cases."
STRING-GREATERP
"Args: (string1 string2
&key (start1 0) (end1 (length string1))
(start2 0) (end2 (length string2)))
Similar to STRING>, but ignores cases."
INTEGERP
"Args: (x)
Returns T if X is an integer (fixnum or bignum); NIL otherwise."
FLOATP
"Args: (x)
Returns T if X is a floating-point number; NIL otherwise."
STRINGP
"Args: (x)
Returns T if X is a string; NIL otherwise."
ARRAYP
"Args: (x)
Returns T if X is an array; NIL otherwise."
STREAMP
"Args: (x)
Returns T if X is a stream object; NIL otherwise."
OBJECTP
"Args: (x)
Returns T if X is an object, NIL otherwise."
STRING-UPCASE
"Args: (string &key (start 0) (end (length string)))
Returns a copy of STRING with all lower case characters converted to
uppercase."
STRING-DOWNCASE
"Args: (string &key (start 0) (end (length string)))
Returns a copy of STRING with all upper case characters converted to
lowercase."
NSTRING-UPCASE
"Args: (string &key (start 0) (end (length string)))
Returns STRING with all lower case characters converted to uppercase."
NSTRING-DOWNCASE
"Args: (string &key (start 0) (end (length string)))
Returns STRING with all upper case characters converted to lowercase."
STRING-TRIM
"Args: (char-bag string)
Returns a copy of STRING with the characters in CHAR-BAG removed from both
ends."
STRING-LEFT-TRIM
"Args: (char-bag string)
Returns a copy of STRING with the characters in CHAR-BAG removed from the
left end."
STRING-RIGHT-TRIM
"Args: (char-bag string)
Returns a copy of STRING with the characters in CHAR-BAG removed from the
right end."
WHEN
"Syntax: (when test {form}*)
If TEST evaluates to non-NIL evaluates FORMs as a PROGN. If not, returns NIL."
UNLESS
"Syntax: (unless test {form}*)
If TEST evaluates to NIL evaluates FORMs as a PROGN. If not, returns NIL."
LOOP
"Syntax: (loop {form}*)
Executes FORMs repeatedly until exited by a THROW or RETURN. The FORMs are
surrounded by an implicit NIL block."
FBOUNDP
"Args: (symbol)
Returns T if SYMBOL has a global function definition or if SYMBOL names a
special form or a macro; NIL otherwise."
PROGV
"Syntax: (progv symbols values {form}*)
SYMBOLS must evaluate to a list of symbols. VALUES must evaluate to a list
of initial values. Evaluates FORMs as a PROGN, with each variable bound
dynamically to the corresponding value."
CHARACTERP
"Args: (x)
Returns T if X is a character; NIL otherwise."
CHAR-INT
"Args: (char)
Returns the ASCII code of CHAR. Equivalent to CHAR-CODE in XLISP."
INT-CHAR
"Args: (integer)
Performs the inverse of CHAR-INT. Equivalent to CODE-CHAR in XLISP."
READ-BYTE
"Args: (stream &optional (eof-error-p t) (eof-value nil))
Reads the next byte from STREAM."
WRITE-BYTE
"Args: (integer &optional stream)
Outputs INTEGER to the binary stream STREAM. Returns INTEGER."
MAKE-STRING-INPUT-STREAM
"Args: (string &optional (start 0) (end (length string)))
Returns an input stream which will supply the characters of String between
Start and End in order."
MAKE-STRING-OUTPUT-STREAM
"Args: ()
Returns an output stream which will accumulate all output given it for
the benefit of the function GET-OUTPUT-STREAM-STRING."
GET-OUTPUT-STREAM-STRING
"Args: (stream)
Returns a string of all the characters sent to STREAM made by
MAKE-STRING-OUTPUT-STREAM since the last call to this function."
GET-OUTPUT-STREAM-LIST
"Args: (stream)
Returns list of elements in stream."
GCD
"Args: (&rest integers)
Returns the greatest common divisor of INTEGERs."
GET-LAMBDA-EXPRESSION
"Args (closure)
Extracts lambda expression from CLOSURE."
MACROEXPAND
"Args: (form &optional env)
If FORM is a macro form expands it repeatedly in environment ENV until
it is not a macro."
MACROEXPAND-1
"Args: (form &optional env)
If FORM is a macro form, then expands it once in environment ENV."
CHAR<
"Args: (char &rest more-chars)
Returns T if the codes of CHARs are in strictly increasing order; NIL
otherwise."
CHAR<=
"Args: (char &rest more-chars)
Returns T if the codes of CHARs are in strictly non-decreasing order; NIL
otherwise."
CHAR=
"Args: (char &rest more-chars)
Returns T if all CHARs are the same character; NIL otherwise."
CHAR/=
"Args: (char &rest more-chars)
Returns T if no two of CHARs are the same character; NIL otherwise."
CHAR>=
"Args: (char &rest more-chars)
Returns T if the codes of CHARs are in strictly non-increasing order; NIL
otherwise."
CHAR>
"Args: (char &rest more-chars)
Returns T if the codes of CHARs are in strictly decreasing order; NIL
otherwise."
CHAR-LESSP
"Args: (char &rest more-chars)
Returns T if the codes of CHARs are in strictly increasing order; NIL
otherwise. For a lower-case character, the code of its upper-case equivalent
is used."
CHAR-NOT-GREATERP
"Args: (char &rest more-chars)
Returns T if the codes of CHARs are in strictly non-decreasing order; NIL
otherwise. For a lower-case character, the code of its upper-case equivalent
is used."
CHAR-EQUAL
"Args: (char &rest more-chars)
Returns T if all of its arguments are the same character; NIL otherwise.
Upper case character and its lower case equivalent are regarded the same."
CHAR-NOT-EQUAL
"Args: (char &rest more-chars)
Returns T if no two of CHARs are the same character; NIL otherwise.
Upper case character and its lower case equivalent are regarded the same."
CHAR-NOT-LESSP
"Args: (char &rest more-chars)
Returns T if the codes of CHARs are in strictly non-increasing order; NIL
otherwise. For a lower-case character, the code of its upper-case equivalent
is used."
CHAR-GREATERP
"Args: (char &rest more-chars)
Returns T if the codes of CHARs are in strictly decreasing order; NIL
otherwise. For a lower-case character, the code of its upper-case equivalent
is used."
UPPER-CASE-P
"Args: (char)
Returns T if CHAR is an upper-case character; NIL otherwise."
LOWER-CASE-P
"Args: (char)
Returns T if CHAR is a lower-case character; NIL otherwise."
BOTH-CASE-P
"Args: (char)
Returns T if CHAR is an alphabetic character; NIL otherwise."
DIGIT-CHAR-P
"Args: (char &optional (radix 10))