Don't use ALEXANDRIA:ENSURE-SYMBOL in base pkgdcl.lisp
[iolib.git] / base / pkgdcl.lisp
blob73987dc74ec41b72be9427eb3c5cf5aaa97806ca
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)
39 (with-package-iterator (iterator packages :external)
40 (loop (multiple-value-bind (morep symbol) (iterator)
41 (unless morep (return))
42 (pushnew (intern (string symbol) :iolib.base)
43 symbols))))
44 symbols)))
45 (export (gather-external-symbols :common-lisp :alexandria :iolib.base)
46 :iolib.base))
49 ;;;-------------------------------------------------------------------------
50 ;;; GRAY stream symbols
51 ;;;-------------------------------------------------------------------------
53 #+cmu
54 (eval-when (:compile-toplevel :load-toplevel :execute)
55 (require :gray-streams))
57 #+allegro
58 (eval-when (:compile-toplevel :load-toplevel :execute)
59 (unless (fboundp 'stream:stream-write-string)
60 (require "streamc.fasl")))
62 (eval-when (:compile-toplevel :load-toplevel :execute)
63 (defvar *gray-stream-symbols*
64 '(#:fundamental-stream #:fundamental-input-stream
65 #:fundamental-output-stream #:fundamental-character-stream
66 #:fundamental-binary-stream #:fundamental-character-input-stream
67 #:fundamental-character-output-stream
68 #:fundamental-binary-input-stream
69 #:fundamental-binary-output-stream #:stream-read-char
70 #:stream-unread-char #:stream-read-char-no-hang
71 #:stream-peek-char #:stream-listen #:stream-read-line
72 #:stream-clear-input #:stream-write-char #:stream-line-column
73 #:stream-start-line-p #:stream-write-string #:stream-terpri
74 #:stream-fresh-line #:stream-finish-output #:stream-force-output
75 #:stream-clear-output #:stream-advance-to-column
76 #:stream-read-byte #:stream-write-byte))
78 (defparameter *gray-stream-package*
79 #+allegro :excl
80 #+cmu :ext
81 #+clisp :gray
82 #+ecl :gray
83 #+(or ccl openmcl) :ccl
84 #+lispworks :stream
85 #+sbcl :sb-gray
86 #-(or allegro cmu clisp ecl ccl openmcl lispworks sbcl)
87 (error "Your CL implementation isn't supported.")))
89 (import (mapcar #'(lambda (s) (find-symbol (string s) *gray-stream-package*))
90 *gray-stream-symbols*)
91 :iolib.base)
93 (export (mapcar (lambda (s) (intern (string s) :iolib.base))
94 (list* '#:trivial-gray-stream-mixin
95 '#:stream-read-sequence
96 '#:stream-write-sequence
97 '#:stream-file-position
98 *gray-stream-symbols*))
99 :iolib.base)