forked from m2ym/trivial-types
-
Notifications
You must be signed in to change notification settings - Fork 0
/
trivial-types.asd
49 lines (41 loc) · 1.66 KB
/
trivial-types.asd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
(in-package :cl-user)
(defpackage :trivial-types-asd
(:use :cl :asdf))
(in-package :trivial-types-asd)
(defsystem :trivial-types
:description "Trivial type definitions"
:long-description "TRIVIAL-TYPES provides missing but important type
definitions such as PROPER-LIST, ASSOCIATION-LIST, PROPERTY-LIST and
TUPLE.
By using these types, you can keep type declarations more
accurate. For example, you may write a class definition like:
(defclass person ()
((name :type string))
((age :type fixnum))
((friends :type list)))
However, it is not obvious for anyone except you that FRIENDS slot has
only a list of person. If you want declare FRIENDS slot more
accurately, PROPER-LIST is the best for that:
(defclass person ()
((name :type string))
((age :type fixnum))
((friends :type (proper-list person))))
In addition, TRIVIAL-TYPES also provides standard designators defined
in ANSI standard such as PACKAGE-DESIGNATOR. They are useful when you
write a function that takes a package-oid argument like:
(defun list-external-symbols (package)
(declare (package-designator package))
(loop for symbol being the external-symbol of package
collect symbol))"
:version "0.1"
:author "Tomohiro Matsuyama"
:license "LLGPL"
:components ((:module "src"
:serial t
:components ((:file "package")
(:file "specials")
(:file "lists")
(:file "designators")
(:file "streams")
(:file "combinators")
(:file "typespecs")))))