aboutsummaryrefslogtreecommitdiff
path: root/README.org
diff options
context:
space:
mode:
authorcolin <colin@cicadas.surf>2024-09-01 08:13:21 -0700
committercolin <colin@cicadas.surf>2024-09-01 08:13:21 -0700
commit071625684fda19cbb47dad95638fc8cd708ac29b (patch)
treefc5c9c54b80c25ebc8858a01c49a766f394f21fa /README.org
parentd0c9a208c86cf12bf9e50c7b20a1625257b40c02 (diff)
Add: TUPLE deftype
Diffstat (limited to 'README.org')
-rw-r--r--README.org10
1 files changed, 10 insertions, 0 deletions
diff --git a/README.org b/README.org
index 9f4cb3e..36b4f4a 100644
--- a/README.org
+++ b/README.org
@@ -6,6 +6,7 @@ A tiny library that provides
valid type specifier
- ~(list-of type &optional len)~ DEFTYPE for a LIST of elements with TYPE
- ~(vector-of type &optional len)~ DEFTYPE for a VECTOR of elements with TYPE
+- ~(tuple &rest types)~ DEFTYPE for a list of exactly TYPES
Here are some examples:
@@ -44,4 +45,13 @@ NIL
> (typep "abab" '(vector-of (member #\a #\b) 4))
T
+;; here is an example of TUPLE
+
+> (typep '(1 #\x nil :foo) '(tuple fixnum character null keyword))
+T
+
+> (typep '(1 #\x nil xxx) '(tuple fixnum character null keyword))
+NIL ; Because XXX is not a KEYWORD
+
+
#+end_src