From 071625684fda19cbb47dad95638fc8cd708ac29b Mon Sep 17 00:00:00 2001 From: colin Date: Sun, 1 Sep 2024 08:13:21 -0700 Subject: Add: TUPLE deftype --- README.org | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'README.org') 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 -- cgit v1.2.3