1 | ;;; known-functions.lisp |
---|
2 | ;;; |
---|
3 | ;;; Copyright (C) 2005-2006 Peter Graves |
---|
4 | ;;; $Id: known-functions.lisp 12393 2010-01-23 09:27:34Z ehuelsmann $ |
---|
5 | ;;; |
---|
6 | ;;; This program is free software; you can redistribute it and/or |
---|
7 | ;;; modify it under the terms of the GNU General Public License |
---|
8 | ;;; as published by the Free Software Foundation; either version 2 |
---|
9 | ;;; of the License, or (at your option) any later version. |
---|
10 | ;;; |
---|
11 | ;;; This program is distributed in the hope that it will be useful, |
---|
12 | ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
14 | ;;; GNU General Public License for more details. |
---|
15 | ;;; |
---|
16 | ;;; You should have received a copy of the GNU General Public License |
---|
17 | ;;; along with this program; if not, write to the Free Software |
---|
18 | ;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
19 | ;;; |
---|
20 | ;;; As a special exception, the copyright holders of this library give you |
---|
21 | ;;; permission to link this library with independent modules to produce an |
---|
22 | ;;; executable, regardless of the license terms of these independent |
---|
23 | ;;; modules, and to copy and distribute the resulting executable under |
---|
24 | ;;; terms of your choice, provided that you also meet, for each linked |
---|
25 | ;;; independent module, the terms and conditions of the license of that |
---|
26 | ;;; module. An independent module is a module which is not derived from |
---|
27 | ;;; or based on this library. If you modify this library, you may extend |
---|
28 | ;;; this exception to your version of the library, but you are not |
---|
29 | ;;; obligated to do so. If you do not wish to do so, delete this |
---|
30 | ;;; exception statement from your version. |
---|
31 | |
---|
32 | (in-package #:system) |
---|
33 | |
---|
34 | (require '#:compiler-types) |
---|
35 | |
---|
36 | ;; (declaim (ftype (function * symbol) copy-symbol gensym)) |
---|
37 | ;; (declaim (ftype (function * symbol) fdefinition-block-name)) |
---|
38 | (defknown (copy-symbol gensym fdefinition-block-name) * symbol) |
---|
39 | |
---|
40 | ;; (declaim (ftype (function (t t) t) gethash1)) |
---|
41 | (defknown gethash1 (t t) t) |
---|
42 | ;; (declaim (ftype (function (t) symbol) make-keyword)) |
---|
43 | (defknown make-keyword (t) symbol) |
---|
44 | |
---|
45 | ;; (declaim (ftype (function * list) |
---|
46 | ;; backq-list backq-list* backq-append backq-nconc |
---|
47 | ;; %class-precedence-list)) |
---|
48 | (defknown (backq-list backq-list* backq-append backq-nconc %class-precedence-list) |
---|
49 | * list) |
---|
50 | |
---|
51 | ;; (declaim (ftype (function * cons) backq-cons)) |
---|
52 | (defknown backq-cons * cons) |
---|
53 | |
---|
54 | ;; (declaim (ftype (function (character) character) char-downcase char-upcase)) |
---|
55 | (defknown (char-downcase char-upcase) (character) character) |
---|
56 | |
---|
57 | ;; (declaim (ftype (function * t) finish-output force-output clear-output terpri fresh-line)) |
---|
58 | (defknown (finish-output force-output clear-output terpri fresh-line) * t) |
---|
59 | |
---|
60 | ;; (declaim (ftype (function (symbol) string) symbol-name)) |
---|
61 | (defknown symbol-name (symbol) string) |
---|
62 | |
---|
63 | ;; (declaim |
---|
64 | ;; (ftype (function * string) |
---|
65 | ;; get-output-stream-string |
---|
66 | ;; nstring-capitalize |
---|
67 | ;; nstring-downcase |
---|
68 | ;; nstring-upcase |
---|
69 | ;; string-capitalize |
---|
70 | ;; string-downcase |
---|
71 | ;; string-upcase |
---|
72 | ;; write-line |
---|
73 | ;; write-string |
---|
74 | ;; )) |
---|
75 | (defknown (get-output-stream-string |
---|
76 | nstring-capitalize |
---|
77 | nstring-downcase |
---|
78 | nstring-upcase |
---|
79 | string-capitalize |
---|
80 | string-downcase |
---|
81 | string-upcase |
---|
82 | write-line |
---|
83 | write-string) * string) |
---|
84 | |
---|
85 | (defknown (%failed-aver |
---|
86 | %ldb |
---|
87 | %make-structure |
---|
88 | %method-function |
---|
89 | put |
---|
90 | %set-cddr |
---|
91 | %stream-terpri |
---|
92 | %stream-write-char |
---|
93 | alphanumericp |
---|
94 | array-has-fill-pointer-p |
---|
95 | aset |
---|
96 | bit-and |
---|
97 | bit-andc1 |
---|
98 | bit-andc2 |
---|
99 | bit-eqv |
---|
100 | bit-ior |
---|
101 | bit-nand |
---|
102 | bit-nor |
---|
103 | bit-not |
---|
104 | bit-orc1 |
---|
105 | bit-orc2 |
---|
106 | bit-xor |
---|
107 | both-case-p |
---|
108 | built-in-function-p |
---|
109 | caadr |
---|
110 | char-equal |
---|
111 | characterp |
---|
112 | charpos |
---|
113 | close |
---|
114 | coerce |
---|
115 | coerce-to-function |
---|
116 | compile-file-pathname |
---|
117 | complex |
---|
118 | conjugate |
---|
119 | count |
---|
120 | count-if |
---|
121 | count-if-not |
---|
122 | delete-file |
---|
123 | directory-namestring |
---|
124 | eighth |
---|
125 | enough-namestring |
---|
126 | every |
---|
127 | fifth |
---|
128 | file-directory-p |
---|
129 | file-namestring |
---|
130 | file-position |
---|
131 | fill |
---|
132 | first |
---|
133 | float |
---|
134 | fmakunbound |
---|
135 | fourth |
---|
136 | fset |
---|
137 | ftype-result-type |
---|
138 | get-internal-real-time |
---|
139 | getf |
---|
140 | hash-table-count |
---|
141 | hash-table-p |
---|
142 | host-namestring |
---|
143 | intersection |
---|
144 | ldb |
---|
145 | ldb-test |
---|
146 | list-all-packages |
---|
147 | list-find* |
---|
148 | load-compiled-function |
---|
149 | lower-case-p |
---|
150 | make-string-output-stream |
---|
151 | make-structure |
---|
152 | map |
---|
153 | merge-pathnames |
---|
154 | namestring |
---|
155 | neq |
---|
156 | nintersection |
---|
157 | ninth |
---|
158 | normalize-type |
---|
159 | nsubst |
---|
160 | nsubst-if |
---|
161 | nsubst-if-not |
---|
162 | nth |
---|
163 | pathname-type |
---|
164 | pathname-type |
---|
165 | pathnamep |
---|
166 | phase |
---|
167 | probe-file |
---|
168 | proclaimed-ftype |
---|
169 | random |
---|
170 | read |
---|
171 | read-char |
---|
172 | read-sequence |
---|
173 | reduce |
---|
174 | replace |
---|
175 | rest |
---|
176 | scale-float |
---|
177 | search |
---|
178 | second |
---|
179 | set |
---|
180 | set-char |
---|
181 | set-schar |
---|
182 | set-std-slot-value |
---|
183 | setf-function-name-p |
---|
184 | seventh |
---|
185 | simple-condition-format-arguments |
---|
186 | simple-condition-format-control |
---|
187 | simple-search |
---|
188 | sixth |
---|
189 | some |
---|
190 | sort |
---|
191 | stable-sort |
---|
192 | standard-object-p |
---|
193 | std-instance-layout |
---|
194 | std-slot-value |
---|
195 | stream-element-type |
---|
196 | stream-line-number |
---|
197 | string-find |
---|
198 | string<= |
---|
199 | structure-object-p |
---|
200 | structure-ref |
---|
201 | structure-set |
---|
202 | subst |
---|
203 | subst-if |
---|
204 | subst-if-not |
---|
205 | svref |
---|
206 | svset |
---|
207 | tenth |
---|
208 | third |
---|
209 | truename |
---|
210 | upper-case-p |
---|
211 | vector |
---|
212 | vector-find* |
---|
213 | vectorp |
---|
214 | write-byte |
---|
215 | write-sequence |
---|
216 | zerop) |
---|
217 | * t) |
---|
218 | |
---|
219 | (defknown length (sequence) (integer 0 #.(1- most-positive-fixnum))) |
---|
220 | |
---|
221 | (defknown (deposit-field dpb logand logcount lognor |
---|
222 | mask-field |
---|
223 | numerator denominator |
---|
224 | boole |
---|
225 | array-dimension |
---|
226 | array-row-major-index |
---|
227 | array-rank |
---|
228 | array-total-size |
---|
229 | %dpb |
---|
230 | ash) |
---|
231 | * integer) |
---|
232 | |
---|
233 | ;; (declaim (ftype (function (t) (integer 0 2147483647)) sxhash)) |
---|
234 | (defknown sxhash (t) (integer 0 2147483647)) |
---|
235 | |
---|
236 | ;; (declaim (ftype (function (character) (unsigned-byte 16)) char-code)) |
---|
237 | (defknown char-code (character) (unsigned-byte 16)) |
---|
238 | |
---|
239 | ;; (declaim (ftype (function (simple-string index) character) schar)) |
---|
240 | (defknown schar (simple-string index) character) |
---|
241 | |
---|
242 | ;; (declaim (ftype (function * character) char write-char)) |
---|
243 | (defknown (char write-char) * character) |
---|
244 | |
---|
245 | (defknown (char= char/= char< char> char<= char>= char-equal char-not-equal |
---|
246 | char-lessp char-greaterp char-not-greaterp char-not-lessp) |
---|
247 | * t) |
---|
248 | |
---|
249 | ;; (declaim |
---|
250 | ;; (ftype (function (real real) real) |
---|
251 | ;; mod rem)) |
---|
252 | (defknown (mod rem) (real real) real) |
---|
253 | |
---|
254 | ;; (declaim (ftype (function (number) rational) rational rationalize)) |
---|
255 | (defknown (rational rationalize) (number) rational) |
---|
256 | |
---|
257 | ;; (declaim (ftype (function * bit) bit sbit)) |
---|
258 | (defknown (bit sbit) * bit) |
---|
259 | |
---|
260 | ;; (declaim (ftype (function * function) make-macro)) |
---|
261 | (defknown make-macro * function) |
---|
262 | |
---|
263 | ;; (declaim (ftype (function * t) %set-arglist)) |
---|
264 | (defknown %set-arglist * t) |
---|
265 | |
---|
266 | ;; (declaim (ftype (function * t) %type-error check-sequence-bounds)) |
---|
267 | (defknown (%type-error check-sequence-bounds) * t) |
---|
268 | |
---|
269 | ;; (declaim (ftype (function * t) out-synonym-of)) |
---|
270 | (defknown out-synonym-of * t) |
---|
271 | |
---|
272 | (defknown (error |
---|
273 | compiler-style-warn |
---|
274 | compiler-warn |
---|
275 | compiler-error |
---|
276 | compiler-unsupported) |
---|
277 | * t) |
---|
278 | |
---|
279 | ;; (declaim (ftype (function (symbol) function) resolve)) |
---|
280 | (defknown resolve (symbol) function) |
---|
281 | |
---|
282 | ;; (declaim (ftype (function (string fixnum character) character) %set-char)) |
---|
283 | (defknown %set-char (string index character) character) |
---|
284 | |
---|
285 | ;; (declaim (ftype (function (t t t) t) set-function-info-value)) |
---|
286 | (defknown set-function-info-value (t t t) t) |
---|
287 | |
---|
288 | ;; (declaim (ftype (function * hash-table) make-hash-table)) |
---|
289 | (defknown make-hash-table * hash-table) |
---|
290 | |
---|
291 | (defknown %class-slots (class) t) |
---|
292 | (defknown set-class-slots (class list) t) |
---|
293 | (defknown %slot-definition-name * t) |
---|
294 | (defknown %slot-definition-initargs * t) |
---|
295 | (defknown %slot-definition-initfunction * t) |
---|
296 | (defknown std-slot-boundp * t) |
---|
297 | (defknown std-slot-value * t) |
---|
298 | (defknown set-std-slot-value * t) |
---|
299 | (defknown open * (or stream null)) |
---|
300 | (defknown make-string-input-stream * stream) |
---|
301 | |
---|
302 | ;; Boolean predicates that can return unboxed Java booleans. |
---|
303 | (defknown (arrayp |
---|
304 | atom |
---|
305 | consp |
---|
306 | endp |
---|
307 | evenp |
---|
308 | floatp |
---|
309 | integerp |
---|
310 | listp |
---|
311 | minusp |
---|
312 | numberp |
---|
313 | oddp |
---|
314 | packagep |
---|
315 | plusp |
---|
316 | rationalp |
---|
317 | readtablep |
---|
318 | realp |
---|
319 | simple-bit-vector-p |
---|
320 | simple-vector-p |
---|
321 | stringp |
---|
322 | symbolp |
---|
323 | zerop) |
---|
324 | (t) boolean) |
---|
325 | |
---|
326 | (defknown (constantp simple-typep typep sys::%typep) |
---|
327 | * boolean) |
---|
328 | |
---|
329 | ;; Boolean comparison operators. |
---|
330 | (defknown (/= |
---|
331 | < |
---|
332 | <= |
---|
333 | = |
---|
334 | > |
---|
335 | >= |
---|
336 | eq |
---|
337 | eql |
---|
338 | equal |
---|
339 | equalp) |
---|
340 | * boolean) |
---|
341 | |
---|
342 | ;; Boolean predicates that can not (currently) return unboxed Java booleans. |
---|
343 | (defknown (bit-vector-p |
---|
344 | compiled-function-p |
---|
345 | complexp |
---|
346 | fboundp |
---|
347 | functionp |
---|
348 | keywordp |
---|
349 | simple-string-p |
---|
350 | typep) |
---|
351 | (t) t) |
---|
352 | |
---|
353 | (defknown (boundp special-operator-p special-variable-p) |
---|
354 | (symbol) t) |
---|
355 | |
---|
356 | ;; Moved here from jvm.lisp. |
---|
357 | (defknown (+ - * / |
---|
358 | 1+ 1- |
---|
359 | car cdr caar cadr cdar cddr cadar caddr cdddr cddddr |
---|
360 | first second third |
---|
361 | list list* |
---|
362 | macro-function |
---|
363 | compiler-macro-function |
---|
364 | sys::%defun |
---|
365 | get |
---|
366 | fdefinition |
---|
367 | array-dimensions array-rank array-total-size |
---|
368 | array-element-type upgraded-array-element-type |
---|
369 | row-major-aref |
---|
370 | quote function |
---|
371 | map |
---|
372 | mapcar |
---|
373 | find position |
---|
374 | append nconc subseq adjoin |
---|
375 | revappend nreconc |
---|
376 | copy-seq |
---|
377 | assoc assoc-if assoc-if-not acons assq assql |
---|
378 | char-int digit-char-p |
---|
379 | member ext:memq |
---|
380 | remove remove-if remove-if-not delete delete-if delete-if-not |
---|
381 | symbol-function |
---|
382 | coerce |
---|
383 | reverse nreverse |
---|
384 | last |
---|
385 | cons rplaca rplacd |
---|
386 | set-car set-cdr |
---|
387 | copy-list copy-tree |
---|
388 | make-sequence make-list make-array make-package |
---|
389 | find-package |
---|
390 | pathname make-pathname pathname-name directory |
---|
391 | package-used-by-list package-shadowing-symbols |
---|
392 | nthcdr |
---|
393 | aref elt |
---|
394 | not null concatenate |
---|
395 | format sys::%format |
---|
396 | prin1 princ print write |
---|
397 | compute-restarts find-restart restart-name |
---|
398 | string |
---|
399 | string= |
---|
400 | setq |
---|
401 | multiple-value-list push pop |
---|
402 | type-of class-of |
---|
403 | abs |
---|
404 | float-radix |
---|
405 | logand logandc1 logandc2 logeqv logior lognand |
---|
406 | lognot logorc1 logorc2 logxor |
---|
407 | logbitp |
---|
408 | slot-boundp slot-value slot-exists-p |
---|
409 | allocate-instance |
---|
410 | find-class |
---|
411 | class-name |
---|
412 | constantly |
---|
413 | exp expt log |
---|
414 | min max |
---|
415 | realpart imagpart |
---|
416 | integer-length |
---|
417 | sqrt isqrt gcd lcm signum |
---|
418 | open |
---|
419 | svref |
---|
420 | fill-pointer |
---|
421 | symbol-value symbol-package package-name |
---|
422 | fourth |
---|
423 | vector-push vector-push-extend |
---|
424 | union nunion |
---|
425 | remove-duplicates delete-duplicates |
---|
426 | read-byte |
---|
427 | fresh-line terpri |
---|
428 | lambda |
---|
429 | ext:classp |
---|
430 | ext:fixnump |
---|
431 | ext:memql |
---|
432 | sys:%generic-function-name |
---|
433 | sys::puthash |
---|
434 | precompiler::precompile1 |
---|
435 | declare |
---|
436 | go |
---|
437 | inst |
---|
438 | emit |
---|
439 | label |
---|
440 | maybe-emit-clear-values |
---|
441 | single-valued-p |
---|
442 | sys:read-8-bits |
---|
443 | sys:write-8-bits |
---|
444 | sys::require-type |
---|
445 | sys::arg-count-error |
---|
446 | sys:subclassp |
---|
447 | sys:gf-required-args |
---|
448 | sys:cache-emf |
---|
449 | sys:get-cached-emf |
---|
450 | ext:autoloadp |
---|
451 | sys::proclaim-ftype-1 |
---|
452 | sys::proclaim-ftype |
---|
453 | ) |
---|
454 | * t) |
---|
455 | |
---|
456 | (defknown make-string * simple-string) |
---|
457 | (defknown concatenate-to-string * simple-string) |
---|
458 | |
---|
459 | (defknown code-char * (or character null)) |
---|
460 | |
---|
461 | (defknown lookup-known-symbol (symbol) t) |
---|
462 | (defknown %class-name (class) symbol) |
---|
463 | |
---|
464 | (defknown adjoin-eql (t t) list) |
---|
465 | |
---|
466 | (provide '#:known-functions) |
---|