Fix RETURN-WRAPPER.
[iolib.git] / iolib / pkgdcl.lisp
blob81100f322a640620e97493babeb6a5ba3a83dc72
1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; indent-tabs-mode: nil -*-
2 ;;;
3 ;;; --- Package definition.
4 ;;;
6 (in-package :common-lisp-user)
8 (macrolet
9 ((defconduit (name &body clauses)
10 (assert (= 1 (length clauses)))
11 (assert (eq (caar clauses) :use))
12 (flet ((get-symbols (packages)
13 (let (symbols)
14 (with-package-iterator (iterator packages :external)
15 (loop (multiple-value-bind (morep symbol) (iterator)
16 (unless morep (return))
17 (push symbol symbols))))
18 (remove-duplicates symbols :test #'eq))))
19 `(defpackage ,name
20 (:use #:common-lisp ,@(cdar clauses))
21 (:export ,@(get-symbols (cdar clauses)))))))
23 (defconduit :iolib
24 (:use :io.multiplex :io.streams :net.sockets)))
26 ;; SBCL changes *package* if LOAD-OPing :iolib in the REPL