source: CGBLisp/latex-doc/infix.tex@ 1

Last change on this file since 1 was 1, checked in by Marek Rychlik, 15 years ago

First import of a version circa 1997.

File size: 10.3 KB
Line 
1\begin{lisp:documentation}{*version*}{PARAMETER}{"1.3 28$-$jun$-$96" }
2{\ } % NO DOCUMENTATION FOR *VERSION*
3\end{lisp:documentation}
4
5\begin{lisp:documentation}{*print$-$infix$-$copyright*}{PARAMETER}{t }
6If non$-$NIL, prints a copyright notice upon loading this file.
7\end{lisp:documentation}
8
9\begin{lisp:documentation}{infix$-$copyright}{FUNCTION}{{\sf \&optional} (stream *standard$-$output*) }
10Prints an INFIX copyright notice and header upon startup.
11\end{lisp:documentation}
12
13\begin{lisp:documentation}{*infix$-$readtable*}{PARAMETER}{(copy$-$readtable nil) }
14{\ } % NO DOCUMENTATION FOR *INFIX-READTABLE*
15\end{lisp:documentation}
16
17\begin{lisp:documentation}{*normal$-$readtable*}{PARAMETER}{(copy$-$readtable nil) }
18{\ } % NO DOCUMENTATION FOR *NORMAL-READTABLE*
19\end{lisp:documentation}
20
21\begin{lisp:documentation}{infix$-$error}{MACRO}{format$-$string {\sf \&rest} args }
22{\ } % NO DOCUMENTATION FOR INFIX-ERROR
23\end{lisp:documentation}
24
25\begin{lisp:documentation}{infix$-$reader}{FUNCTION}{stream subchar arg }
26{\ } % NO DOCUMENTATION FOR INFIX-READER
27\end{lisp:documentation}
28
29\begin{lisp:documentation}{string$-$$>$prefix}{FUNCTION}{string }
30Convert a string to a prefix s$-$expression using the infix reader.
31 If the argument is not a string, just return it as is.
32\end{lisp:documentation}
33
34\begin{lisp:documentation}{read$-$infix}{FUNCTION}{stream }
35{\ } % NO DOCUMENTATION FOR READ-INFIX
36\end{lisp:documentation}
37
38\begin{lisp:documentation}{read$-$regular}{FUNCTION}{stream }
39{\ } % NO DOCUMENTATION FOR READ-REGULAR
40\end{lisp:documentation}
41
42\begin{lisp:documentation}{same$-$operator$-$p}{FUNCTION}{x y }
43{\ } % NO DOCUMENTATION FOR SAME-OPERATOR-P
44\end{lisp:documentation}
45
46\begin{lisp:documentation}{same$-$token$-$p}{FUNCTION}{x y }
47{\ } % NO DOCUMENTATION FOR SAME-TOKEN-P
48\end{lisp:documentation}
49
50\begin{lisp:documentation}{*peeked$-$token*}{VARIABLE}{nil }
51{\ } % NO DOCUMENTATION FOR *PEEKED-TOKEN*
52\end{lisp:documentation}
53
54\begin{lisp:documentation}{read$-$token}{FUNCTION}{stream }
55{\ } % NO DOCUMENTATION FOR READ-TOKEN
56\end{lisp:documentation}
57
58\begin{lisp:documentation}{peek$-$token}{FUNCTION}{stream }
59{\ } % NO DOCUMENTATION FOR PEEK-TOKEN
60\end{lisp:documentation}
61
62\begin{lisp:documentation}{fancy$-$number$-$format$-$p}{FUNCTION}{left operator stream }
63{\ } % NO DOCUMENTATION FOR FANCY-NUMBER-FORMAT-P
64\end{lisp:documentation}
65
66\begin{lisp:documentation}{valid$-$numberp}{FUNCTION}{string }
67{\ } % NO DOCUMENTATION FOR VALID-NUMBERP
68\end{lisp:documentation}
69
70\begin{lisp:documentation}{gather$-$superiors}{FUNCTION}{previous$-$operator stream }
71Gathers an expression whose operators all exceed the precedence of
72the operator to the left.
73\end{lisp:documentation}
74
75\begin{lisp:documentation}{get$-$first$-$token}{FUNCTION}{stream }
76{\ } % NO DOCUMENTATION FOR GET-FIRST-TOKEN
77\end{lisp:documentation}
78
79\begin{lisp:documentation}{apply$-$token$-$prefix$-$operator}{FUNCTION}{token stream }
80{\ } % NO DOCUMENTATION FOR APPLY-TOKEN-PREFIX-OPERATOR
81\end{lisp:documentation}
82
83\begin{lisp:documentation}{get$-$next$-$token}{FUNCTION}{stream left }
84{\ } % NO DOCUMENTATION FOR GET-NEXT-TOKEN
85\end{lisp:documentation}
86
87\begin{lisp:documentation}{apply$-$token$-$infix$-$operator}{FUNCTION}{token left stream }
88{\ } % NO DOCUMENTATION FOR APPLY-TOKEN-INFIX-OPERATOR
89\end{lisp:documentation}
90
91\begin{lisp:documentation}{infix$-$read$-$delimited$-$list}{FUNCTION}{end$-$token delimiter$-$token stream }
92{\ } % NO DOCUMENTATION FOR INFIX-READ-DELIMITED-LIST
93\end{lisp:documentation}
94
95\begin{lisp:documentation}{*operator$-$ordering*}{PARAMETER}{'(([ ( !) (\symbol{94}) (~) (* / \%) (+ $-$) ($<$$<$ $>$$>$) ($<$ == $>$ $<$= != $>$=) (\&) (\symbol{94}\symbol{94}) (|) (not) (and) (or) (= := += $-$= *= /=) (,) (if) (then else) (] )) (\%infix$-$end$-$token\%)) }
96Ordered list of operators of equal precedence.
97\end{lisp:documentation}
98
99\begin{lisp:documentation}{operator$-$lessp}{FUNCTION}{op1 op2 }
100{\ } % NO DOCUMENTATION FOR OPERATOR-LESSP
101\end{lisp:documentation}
102
103\begin{lisp:documentation}{*right$-$associative$-$operators*}{PARAMETER}{'(\symbol{94} =) }
104{\ } % NO DOCUMENTATION FOR *RIGHT-ASSOCIATIVE-OPERATORS*
105\end{lisp:documentation}
106
107\begin{lisp:documentation}{operator$-$right$-$associative$-$p}{FUNCTION}{operator }
108{\ } % NO DOCUMENTATION FOR OPERATOR-RIGHT-ASSOCIATIVE-P
109\end{lisp:documentation}
110
111\begin{lisp:documentation}{*token$-$operators*}{VARIABLE}{nil }
112{\ } % NO DOCUMENTATION FOR *TOKEN-OPERATORS*
113\end{lisp:documentation}
114
115\begin{lisp:documentation}{*token$-$prefix$-$operator$-$table*}{VARIABLE}{(make$-$hash$-$table) }
116{\ } % NO DOCUMENTATION FOR *TOKEN-PREFIX-OPERATOR-TABLE*
117\end{lisp:documentation}
118
119\begin{lisp:documentation}{*token$-$infix$-$operator$-$table*}{VARIABLE}{(make$-$hash$-$table) }
120{\ } % NO DOCUMENTATION FOR *TOKEN-INFIX-OPERATOR-TABLE*
121\end{lisp:documentation}
122
123\begin{lisp:documentation}{token$-$operator$-$p}{FUNCTION}{token }
124{\ } % NO DOCUMENTATION FOR TOKEN-OPERATOR-P
125\end{lisp:documentation}
126
127\begin{lisp:documentation}{get$-$token$-$prefix$-$operator}{FUNCTION}{token }
128{\ } % NO DOCUMENTATION FOR GET-TOKEN-PREFIX-OPERATOR
129\end{lisp:documentation}
130
131\begin{lisp:documentation}{get$-$token$-$infix$-$operator}{FUNCTION}{token }
132{\ } % NO DOCUMENTATION FOR GET-TOKEN-INFIX-OPERATOR
133\end{lisp:documentation}
134
135\begin{lisp:documentation}{define$-$token$-$operator}{MACRO}{operator$-$name {\sf \&key} (prefix nil prefix$-$p) (infix nil infix$-$p) }
136{\ } % NO DOCUMENTATION FOR DEFINE-TOKEN-OPERATOR
137\end{lisp:documentation}
138
139\begin{lisp:documentation}{define$-$character$-$tokenization}{MACRO}{char function }
140{\ } % NO DOCUMENTATION FOR DEFINE-CHARACTER-TOKENIZATION
141\end{lisp:documentation}
142
143\begin{lisp:documentation}{post$-$process$-$expression}{FUNCTION}{expression }
144{\ } % NO DOCUMENTATION FOR POST-PROCESS-EXPRESSION
145\end{lisp:documentation}
146
147\begin{lisp:documentation}{*test$-$cases*}{PARAMETER}{'((1 * +2 (* 1 2)) (1 * $-$2 (* 1 ($-$ 2))) (1 * /2 (* 1 (/ 2))) (/2 (/ 2)) (not true (not true)) (foo$\backslash$$-$bar foo$-$bar) (a + b$-$c (+ a b ($-$ c))) (a + b$\backslash$$-$c (+ a b$-$c)) (f$\backslash$oo foo) (!foo$-$bar * 2 (* foo$-$bar 2))
148 (!(foo bar baz) (foo bar baz)) (!foo$-$bar foo$-$bar) (!foo$-$bar foo$-$bar) (a+$-$b (+ a ($-$ b))) (a+b (+ a b)) (a+b*c (+ a (* b c))) (a+b+c (+ a b c)) (a+b$-$c (+ a b ($-$ c))) (a+b$-$c+d (+ a b ($-$ c) d))
149 (a+b$-$c$-$d (+ a b ($-$ c) ($-$ d))) (a$-$b ($-$ a b)) (a*b (* a b)) (a*b*c (* a b c)) (a*b+c (+ (* a b) c)) (a/b (/ a b)) (a\symbol{94}b (expt a b)) (foo/$-$bar (/ foo ($-$ bar))) (1+2*3\symbol{94}4 (+ 1 (* 2 (expt 3 4))))
150 (1+2*3\symbol{94}4+5 (+ 1 (* 2 (expt 3 4)) 5)) (2*3\symbol{94}4+1 (+ (* 2 (expt 3 4)) 1)) (2+3\symbol{94}4*5 (+ 2 (* (expt 3 4) 5))) (2\symbol{94}3\symbol{94}4 (expt 2 (expt 3 4))) (x\symbol{94}2 + y\symbol{94}2 (+ (expt x 2) (expt y 2))) ((1+2)/3 (/ (+ 1 2) 3)) ((a=b) (setq a b))
151 ((a=b,b=c) (progn (setq a b) (setq b c))) (1*(2+3) (* 1 (+ 2 3))) (1+2/3 (+ 1 (/ 2 3))) (a,b (progn a b)) (a,b,c (progn a b c)) (foo(a,b,(c,d)) (foo a b (progn c d))) (foo(a,b,c) (foo a b c))
152 ((a+b,c) (progn (+ a b) c)) (1 1) ($-$1 ($-$ 1)) (+1 1) (1. 1) (1.1 1.1) (1e3 1000.0) (1e$-$3 0.001) (1f$-$3 0.001) (1e$-$3e ($-$ 1e 3e)) (!1e$-$3 0.001) (a and b and c (and a b c)) (a and b or c (or (and a b) c))
153 (a and b (and a b)) (a or b and c (or a (and b c))) (a or b (or a b)) (a$<$b and b$<$c (and ($<$ a b) ($<$ b c))) (if (if a then b else c) then e (when (if a b c) e)) (if 1 then 2 else 3+4 (if 1 2 (+ 3 4)))
154 ((if 1 then 2 else 3)+4 (+ (if 1 2 3) 4)) (if a $<$ b then b else a (if ($<$ a b) b a)) (if a and b then c and d else e and f (if (and a b) (and c d) (and e f)))
155 (if a or b then c or d else e or f (if (or a b) (or c d) (or e f))) (if a then (if b then c else d) else e (if a (if b c d) e)) (if a then (if b then c) else d (if a (when b c) d))
156 (if a then b else c (if a b c)) (if a then b (when a b)) (if a then if b then c else d else e (if a (if b c d) e)) (if a then if b then c else d (when a (if b c d)))
157 (if if a then b else c then e (when (if a b c) e)) (if not a and not b then c (when (and (not a) (not b)) c)) (if not a then not b else not c and d (if (not a) (not b) (and (not c) d)))
158 (not a and not b (and (not a) (not b))) (not a or not b (or (not a) (not b))) (not a$<$b and not b$<$c (and (not ($<$ a b)) (not ($<$ b c)))) (not a$<$b (not ($<$ a b))) (a[i,k]*b[j,k] (* (aref a i k) (aref b j k)))
159 (foo(bar)=foo[bar,baz] (setf (foo bar) (aref foo bar baz))) (foo(bar,baz) (foo bar baz)) (foo[bar,baz] (aref foo bar baz)) (foo[bar,baz]=barf (setf (aref foo bar baz) barf))
160 (max = if a $<$ b then b else a (setq max (if ($<$ a b) b a))) (a $<$ b $<$ c ($<$ a b c)) (a $<$ b $<$= c (and ($<$ a b) ($<$= b c))) (a $<$= b $<$= c ($<$= a b c)) (a $<$= b $<$= c ($<$= a b c)) (a!=b and b$<$c (and (not (= a b)) ($<$ b c)))
161 (a!=b (not (= a b))) (a$<$b ($<$ a b)) (a==b (= a b)) (a*b(c)+d (+ (* a (b c)) d)) (a+b(c)*d (+ a (* (b c) d))) (a+b(c)+d (+ a (b c) d)) (d+a*b(c) (+ d (* a (b c)))) (+a+b (+ a b)) ($-$a+b (+ ($-$ a) b))
162 ($-$a$-$b (+ ($-$ a) ($-$ b))) ($-$a$-$b$-$c (+ ($-$ a) ($-$ b) ($-$ c))) (a*b/c (/ (* a b) c)) (a+b$-$c (+ a b ($-$ c))) (a$-$b$-$c ($-$ a b c)) (a/b*c (* (/ a b) c)) (a/b/c (/ a b c)) (/a/b (/ (* a b))) (a\symbol{94}b\symbol{94}c (expt a (expt b c)))
163 (a(d)\symbol{94}b\symbol{94}c (expt (a d) (expt b c))) (a$<$b+c$<$d ($<$ a (+ b c) d)) (1*~2+3 (+ (* 1 (lognot 2)) 3)) (1+~2*3 (+ 1 (* (lognot 2) 3))) (1+~2+3 (+ 1 (lognot 2) 3)) (f(a)*=g(b) (setf (f a) (* (f a) (g b))))
164 (f(a)+=g(b) (incf (f a) (g b))) (f(a)$-$=g(b) (decf (f a) (g b))) (f(a)/=g(b) (setf (f a) (/ (f a) (g b)))) (a\&b (logand a b)) (a\symbol{94}\symbol{94}b (logxor a b)) (a|b (logior a b)) (a$<$$<$b (ash a b)) (a$>$$>$b (ash a ($-$ b)))
165 (~a (lognot a)) (a\&\&b (and a b)) (a||b (or a b)) (a\%b (mod a b))
166 (x\symbol{94}2 ; the x coordinate
167 + y\symbol{94}2 ; the y coordinate error)
168 (x\symbol{94}2 ; the x coordinate
169 + y\symbol{94}2 ; the y coordinate
170 (+ (expt x 2) (expt y 2)))
171 (foo(bar,baz error) (foo(bar,baz)) (foo bar baz)) (foo[bar,baz]] error) ([foo,bar] error) (and a error) ($<$ a error) (=bar error) (*bar error) (a not b error) (a if b then c error) ( error) ()a error) (]a error)) }
172{\ } % NO DOCUMENTATION FOR *TEST-CASES*
173\end{lisp:documentation}
174
175\begin{lisp:documentation}{test$-$infix}{FUNCTION}{{\sf \&optional} (tests *test$-$cases*) }
176{\ } % NO DOCUMENTATION FOR TEST-INFIX
177\end{lisp:documentation}
178
179\begin{lisp:documentation}{test$-$infix$-$case}{FUNCTION}{string result }
180{\ } % NO DOCUMENTATION FOR TEST-INFIX-CASE
181\end{lisp:documentation}
182
Note: See TracBrowser for help on using the repository browser.