Add package IOLIB as conduit of IO.MULTIPLEX, IO.STREAMS AND NET.SOCKETS
[iolib.git] / iolib / pkgdcl.lisp
blob2b1dea68e842e635ec1b9c6beffd4359a0c53694
1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Indent-tabs-mode: NIL -*-
2 ;;;
3 ;;; pkgdcl.lisp --- Package definition.
4 ;;;
5 ;;; Copyright (C) 2008, Stelian Ionescu <sionescu@common-lisp.net>
6 ;;;
7 ;;; This code is free software; you can redistribute it and/or
8 ;;; modify it under the terms of the version 2.1 of
9 ;;; the GNU Lesser General Public License as published by
10 ;;; the Free Software Foundation, as clarified by the
11 ;;; preamble found here:
12 ;;; http://opensource.franz.com/preamble.html
13 ;;;
14 ;;; This program is distributed in the hope that it will be useful,
15 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU Lesser General
20 ;;; Public License along with this library; if not, write to the
21 ;;; Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
22 ;;; Boston, MA 02110-1301, USA
24 (in-package :common-lisp-user)
26 (macrolet
27 ((defconduit (name &body clauses)
28 (assert (= 1 (length clauses)))
29 (assert (eq (caar clauses) :use))
30 (flet ((get-symbols (packages)
31 (loop :for sym :being :the :external-symbols :of packages
32 :collect sym :into symbols
33 :finally (return (remove-duplicates symbols :test #'eq)))))
34 `(defpackage ,name
35 (:use #:common-lisp ,@(cdar clauses))
36 (:export ,@(get-symbols (cdar clauses)))))))
38 (defconduit :iolib
39 (:use :io.multiplex :io.streams :net.sockets)))