source: branches/0.17.x/abcl/src/org/armedbear/lisp/known-functions.lisp

Last change on this file was 11391, checked in by vvoutilainen, 17 years ago

ABCL license is GPL + Classpath exception. This was intended
by Peter Graves, the original author. For reference, see
http://sourceforge.net/mailarchive/forum.php?thread_name=20040721115302.839%40prufrock&forum_name=armedbear-j-announce

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 13.0 KB
Line 
1;;; known-functions.lisp
2;;;
3;;; Copyright (C) 2005-2006 Peter Graves
4;;; $Id: known-functions.lisp 11391 2008-11-15 22:38:34Z vvoutilainen $
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                         %dpb
227                         ash)
228  * integer)
229
230;; (declaim (ftype (function (t) (integer 0 2147483647)) sxhash))
231(defknown sxhash (t) (integer 0 2147483647))
232
233;; (declaim (ftype (function (character) (unsigned-byte 16)) char-code))
234(defknown char-code (character) (unsigned-byte 16))
235
236;; (declaim (ftype (function (simple-string index) character) schar))
237(defknown schar (simple-string index) character)
238
239;; (declaim (ftype (function * character) char write-char))
240(defknown (char write-char) * character)
241
242(defknown (char= char/= char< char> char<= char>= char-equal char-not-equal
243                 char-lessp char-greaterp char-not-greaterp char-not-lessp)
244  * t)
245
246;; (declaim
247;;  (ftype (function (real real) real)
248;;         mod rem))
249(defknown (mod rem) (real real) real)
250
251;; (declaim (ftype (function (number) rational) rational rationalize))
252(defknown (rational rationalize) (number) rational)
253
254;; (declaim (ftype (function * bit) bit sbit))
255(defknown (bit sbit) * bit)
256
257;; (declaim (ftype (function * function) make-macro))
258(defknown make-macro * function)
259
260;; (declaim (ftype (function * t) %set-arglist))
261(defknown %set-arglist * t)
262
263;; (declaim (ftype (function * t) %type-error check-sequence-bounds))
264(defknown (%type-error check-sequence-bounds) * t)
265
266;; (declaim (ftype (function * t) out-synonym-of))
267(defknown out-synonym-of * t)
268
269(defknown (error
270           compiler-style-warn
271           compiler-warn
272           compiler-error
273           compiler-unsupported)
274  * t)
275
276;; (declaim (ftype (function (symbol) function) resolve))
277(defknown resolve (symbol) function)
278
279;; (declaim (ftype (function (string fixnum character) character) %set-char))
280(defknown %set-char (string index character) character)
281
282;; (declaim (ftype (function (t t t) t) set-function-info-value))
283(defknown set-function-info-value (t t t) t)
284
285;; (declaim (ftype (function * hash-table) make-hash-table))
286(defknown make-hash-table * hash-table)
287
288(defknown %class-slots (class) t)
289(defknown set-class-slots (class list) t)
290(defknown %slot-definition-name * t)
291(defknown %slot-definition-initargs * t)
292(defknown %slot-definition-initfunction * t)
293(defknown std-slot-boundp * t)
294(defknown std-slot-value * t)
295(defknown set-std-slot-value * t)
296(defknown open * (or stream null))
297(defknown make-string-input-stream * stream)
298
299;; Boolean predicates that can return unboxed Java booleans.
300(defknown (arrayp
301           atom
302           consp
303           endp
304           evenp
305           floatp
306           integerp
307           listp
308           minusp
309           numberp
310           oddp
311           packagep
312           plusp
313           rationalp
314           readtablep
315           realp
316           simple-bit-vector-p
317           simple-vector-p
318           stringp
319           symbolp
320           zerop)
321  (t) boolean)
322
323(defknown (constantp simple-typep typep sys::%typep)
324  * boolean)
325
326;; Boolean comparison operators.
327(defknown (/=
328           <
329           <=
330           =
331           >
332           >=
333           eq
334           eql
335           equal
336           equalp)
337  * boolean)
338
339;; Boolean predicates that can not (currently) return unboxed Java booleans.
340(defknown (bit-vector-p
341           compiled-function-p
342           complexp
343           fboundp
344           functionp
345           keywordp
346           simple-string-p
347           typep)
348  (t) t)
349
350(defknown (boundp special-operator-p special-variable-p)
351  (symbol) t)
352
353;; Moved here from jvm.lisp.
354(defknown (+ - * /
355             1+ 1-
356             car cdr caar cadr cdar cddr cadar caddr cdddr cddddr
357             first second third
358             list list*
359             macro-function
360             compiler-macro-function
361             sys::%defun
362             get
363             fdefinition
364             array-dimensions array-rank array-total-size
365             array-element-type upgraded-array-element-type
366             row-major-aref
367             quote function
368             map
369             mapcar
370             find position
371             append nconc subseq adjoin
372             revappend nreconc
373             copy-seq
374             assoc assoc-if assoc-if-not acons assq assql
375             char-int digit-char-p
376             member ext:memq
377             remove remove-if remove-if-not delete delete-if delete-if-not
378             symbol-function
379             coerce
380             reverse nreverse
381             last
382             cons rplaca rplacd
383             set-car set-cdr
384             copy-list copy-tree
385             make-sequence make-list make-array make-package
386             find-package
387             pathname make-pathname pathname-name directory
388             package-used-by-list package-shadowing-symbols
389             nthcdr
390             aref elt
391             not null concatenate
392             format sys::%format
393             prin1 princ print write
394             compute-restarts find-restart restart-name
395             string
396             string=
397             setq
398             multiple-value-list push pop
399             type-of class-of
400             abs
401             float-radix
402             logand logandc1 logandc2 logeqv logior lognand
403             lognot logorc1 logorc2 logxor
404             logbitp
405             slot-boundp slot-value slot-exists-p
406             allocate-instance
407             find-class
408             class-name
409             constantly
410             exp expt log
411             min max
412             realpart imagpart
413             integer-length
414             sqrt isqrt gcd lcm signum
415             open
416             svref
417             fill-pointer
418             symbol-value symbol-package package-name
419             fourth
420             vector-push vector-push-extend
421             union nunion
422             remove-duplicates delete-duplicates
423             read-byte
424             fresh-line terpri
425             lambda
426             ext:classp
427             ext:fixnump
428             ext:memql
429             sys:%generic-function-name
430             sys::puthash
431             precompiler::precompile1
432             declare
433             go
434             inst
435             emit
436             label
437             maybe-emit-clear-values
438             single-valued-p
439             sys:read-8-bits
440             sys:write-8-bits
441             sys::require-type
442             sys::arg-count-error
443             sys:subclassp
444             sys:gf-required-args
445             sys:cache-emf
446             sys:get-cached-emf
447             ext:autoloadp
448             sys::proclaim-ftype-1
449             sys::proclaim-ftype
450             )
451  * t)
452
453(defknown make-string * simple-string)
454(defknown concatenate-to-string * simple-string)
455
456(defknown code-char * (or character null))
457
458(defknown lookup-known-symbol (symbol) t)
459(defknown %class-name (class) symbol)
460
461(defknown adjoin-eql (t t) list)
462
463(provide '#:known-functions)
Note: See TracBrowser for help on using the repository browser.