Fix tests.
[iolib.git] / base / pkgdcl.lisp
blobf40b457da3b4e694778cef13624d0f3e06c8d947
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
14 ;; RETURN*
15 #:return* #:lambda* #:defun #:defmethod
16 #:defmacro #:define-compiler-macro
17 ;; DEFOBSOLETE
18 #:defobsolete
19 #:deprecation-warning
20 #:deprecation-warning-function-name
21 #:deprecation-warning-type
22 #:deprecation-warning-reason
23 ;; Reader utils
24 #:define-syntax
25 #:enable-reader-macro #:enable-reader-macro*
26 #:disable-reader-macro #:disable-reader-macro*
27 ;; SPLIT-SEQUENCE
28 #:split-sequence #:split-sequence-if #:split-sequence-if-not
29 ;; Misc
30 #:function-name #:function-name-p
31 #:check-bounds
32 ;; Matching
33 #:multiple-value-case #:flags-case
34 ;; Time
35 #:decode-timeout #:normalize-timeout #:clamp-timeout))
37 (flet ((gather-external-symbols (&rest packages)
38 (let ((symbols (make-hash-table :test #'eq)))
39 (with-package-iterator (iterator packages :external)
40 (loop (multiple-value-bind (morep symbol) (iterator)
41 (unless morep (return))
42 (setf (gethash (alexandria:ensure-symbol symbol :iolib.base) symbols) t))))
43 (alexandria:hash-table-keys symbols))))
44 (export (gather-external-symbols :common-lisp :alexandria :iolib.base)
45 :iolib.base))
48 ;;;-------------------------------------------------------------------------
49 ;;; GRAY stream symbols
50 ;;;-------------------------------------------------------------------------
52 #+cmu
53 (eval-when (:compile-toplevel :load-toplevel :execute)
54 (require :gray-streams))
56 #+allegro
57 (eval-when (:compile-toplevel :load-toplevel :execute)
58 (unless (fboundp 'stream:stream-write-string)
59 (require "streamc.fasl")))
61 (eval-when (:compile-toplevel :load-toplevel :execute)
62 (defvar *gray-stream-symbols*
63 '(#:fundamental-stream #:fundamental-input-stream
64 #:fundamental-output-stream #:fundamental-character-stream
65 #:fundamental-binary-stream #:fundamental-character-input-stream
66 #:fundamental-character-output-stream
67 #:fundamental-binary-input-stream
68 #:fundamental-binary-output-stream #:stream-read-char
69 #:stream-unread-char #:stream-read-char-no-hang
70 #:stream-peek-char #:stream-listen #:stream-read-line
71 #:stream-clear-input #:stream-write-char #:stream-line-column
72 #:stream-start-line-p #:stream-write-string #:stream-terpri
73 #:stream-fresh-line #:stream-finish-output #:stream-force-output
74 #:stream-clear-output #:stream-advance-to-column
75 #:stream-read-byte #:stream-write-byte))
77 (defparameter *gray-stream-package*
78 #+allegro :excl
79 #+cmu :ext
80 #+clisp :gray
81 #+ecl :gray
82 #+(or ccl openmcl) :ccl
83 #+lispworks :stream
84 #+sbcl :sb-gray
85 #-(or allegro cmu clisp ecl ccl openmcl lispworks sbcl)
86 (error "Your CL implementation isn't supported.")))
88 (import (mapcar #'(lambda (s) (find-symbol (string s) *gray-stream-package*))
89 *gray-stream-symbols*)
90 :iolib.base)
92 (export (mapcar (lambda (s) (alexandria:ensure-symbol s :iolib.base))
93 (list* '#:trivial-gray-stream-mixin
94 '#:stream-read-sequence
95 '#:stream-write-sequence
96 '#:stream-file-position
97 *gray-stream-symbols*))
98 :iolib.base)