Rename condition BUG to IOLIB-BUG.
[iolib.git] / base / pkgdcl.lisp
blobfc1260d51f63d5b28c4a7171668e35d791ce3284
1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; indent-tabs-mode: nil -*-
2 ;;;
3 ;;; --- Package definition.
4 ;;;
6 (in-package :common-lisp-user)
8 (defpackage :iolib.base
9 (:use #:common-lisp :alexandria)
10 (:shadow #:defun #:defmethod #:defmacro #:define-compiler-macro)
11 (:export
12 ;; Conditions
13 #:bug #:iolib-bug
14 ;; Debugging
15 #:*safety-checks*
16 #:debug-only #:debug-only*
17 #:production-only #:production-only*
18 ;; Types
19 #:function-designator
20 ;; RETURN*
21 #:return* #:lambda* #:defun #:defmethod
22 #:defmacro #:define-compiler-macro
23 ;; DEFOBSOLETE
24 #:defobsolete
25 #:deprecation-warning
26 #:deprecation-warning-function-name
27 #:deprecation-warning-type
28 #:deprecation-warning-reason
29 ;; Reader utils
30 #:define-syntax
31 #:enable-reader-macro #:enable-reader-macro*
32 #:disable-reader-macro #:disable-reader-macro*
33 ;; SPLIT-SEQUENCE
34 #:split-sequence #:split-sequence-if #:split-sequence-if-not
35 ;; Misc
36 #:function-name #:function-name-p
37 #:check-bounds
38 ;; Matching
39 #:multiple-value-case #:flags-case
40 ;; Time
41 #:decode-timeout #:normalize-timeout #:clamp-timeout))
43 (flet ((gather-external-symbols (&rest packages)
44 (let (symbols)
45 (with-package-iterator (iterator packages :external)
46 (loop (multiple-value-bind (morep symbol) (iterator)
47 (unless morep (return))
48 (pushnew (intern (string symbol) :iolib.base)
49 symbols))))
50 symbols)))
51 (export (gather-external-symbols :common-lisp :alexandria :iolib.base)
52 :iolib.base))
55 ;;;-------------------------------------------------------------------------
56 ;;; GRAY stream symbols
57 ;;;-------------------------------------------------------------------------
59 #+cmu
60 (eval-when (:compile-toplevel :load-toplevel :execute)
61 (require :gray-streams))
63 #+allegro
64 (eval-when (:compile-toplevel :load-toplevel :execute)
65 (unless (fboundp 'stream:stream-write-string)
66 (require "streamc.fasl")))
68 (eval-when (:compile-toplevel :load-toplevel :execute)
69 (defvar *gray-stream-symbols*
70 '(#:fundamental-stream #:fundamental-input-stream
71 #:fundamental-output-stream #:fundamental-character-stream
72 #:fundamental-binary-stream #:fundamental-character-input-stream
73 #:fundamental-character-output-stream
74 #:fundamental-binary-input-stream
75 #:fundamental-binary-output-stream #:stream-read-char
76 #:stream-unread-char #:stream-read-char-no-hang
77 #:stream-peek-char #:stream-listen #:stream-read-line
78 #:stream-clear-input #:stream-write-char #:stream-line-column
79 #:stream-start-line-p #:stream-write-string #:stream-terpri
80 #:stream-fresh-line #:stream-finish-output #:stream-force-output
81 #:stream-clear-output #:stream-advance-to-column
82 #:stream-read-byte #:stream-write-byte))
84 (defparameter *gray-stream-package*
85 #+allegro :excl
86 #+(or cmu scl) :ext
87 #+(or clisp ecl) :gray
88 #+(or ccl openmcl) :ccl
89 #+lispworks :stream
90 #+sbcl :sb-gray
91 #-(or allegro cmu scl clisp ecl ccl openmcl lispworks sbcl)
92 (error "Your CL implementation isn't supported.")))
94 (eval-when (:compile-toplevel :load-toplevel :execute)
95 (import (mapcar #'(lambda (s) (intern (string s) *gray-stream-package*))
96 *gray-stream-symbols*)
97 :iolib.base)
98 (export (mapcar (lambda (s) (intern (string s) :iolib.base))
99 (list* '#:trivial-gray-stream-mixin
100 '#:stream-read-sequence
101 '#:stream-write-sequence
102 '#:stream-file-position
103 *gray-stream-symbols*))
104 :iolib.base))