RUN-PROGRAM: close the standard input
[iolib.git] / src / base / types.lisp
blobc51d4239efe76ce865b06012e5434773bfe4373d
1 ;;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
2 ;;;
3 ;;; --- Types.
4 ;;;
6 (in-package :iolib.base)
8 (deftype function-designator ()
9 '(or symbol function))
11 (defun symbol-with-name-of-length-one (thing)
12 (if (and (symbolp thing)
13 (= 1 (length (symbol-name thing))))
14 (char (symbol-name thing) 0)
15 nil))
17 (deftype character-designator ()
18 '(or character (string 1) (satisfies symbol-with-name-of-length-one)))
21 ;; Vector types
23 (deftype ub8 () '(unsigned-byte 8))
24 (deftype ub16 () '(unsigned-byte 16))
25 (deftype ub32 () '(unsigned-byte 32))
26 (deftype ub64 () '(unsigned-byte 64))
27 (deftype sb8 () '(signed-byte 8))
28 (deftype sb16 () '(signed-byte 16))
29 (deftype sb32 () '(signed-byte 32))
30 (deftype sb64 () '(signed-byte 64))
32 (deftype ub8-sarray (&optional (size '*))
33 `(simple-array ub8 (,size)))
34 (deftype ub8-vector (&optional (size '*))
35 `(vector ub8 ,size))
37 (deftype ub16-sarray (&optional (size '*))
38 `(simple-array ub16 (,size)))
39 (deftype ub16-vector (&optional (size '*))
40 `(vector ub16 ,size))
42 (deftype ub32-sarray (&optional (size '*))
43 `(simple-array ub32 (,size)))
44 (deftype ub32-vector (&optional (size '*))
45 `(vector ub32 ,size))
47 (deftype ub64-sarray (&optional (size '*))
48 `(simple-array ub64 (,size)))
49 (deftype ub64-vector (&optional (size '*))
50 `(vector ub64 ,size))