1 (in-package :sb-posix-internal)
2 (defvar *designator-types* (make-hash-table :test #'equal))
4 (defmacro define-designator (name result &body conversions)
5 (let ((type `(quote (or ,@(mapcar #'car conversions))))
6 (typename (intern (format nil "~A-~A"
8 (symbol-name :designator))
11 (eval-when (:compile-toplevel :load-toplevel :execute)
12 (deftype ,typename () ,type)
13 (setf (gethash ',name *designator-types*) ',result))
14 (defun ,(intern (symbol-name name) :sb-posix) (,name)
15 (declare (type ,typename ,name))