aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcolin <colin@cicadas.surf>2024-07-28 08:34:04 -0700
committercolin <colin@cicadas.surf>2024-07-28 08:34:04 -0700
commit87cf60328f59b739de1b282dbd020e70a84f076e (patch)
tree27e1caa2e9bc3141b547c6b536fd2c6b586af88d
parent9d822018ee36a87ee4d9f81a0ac962e78498ca79 (diff)
Add barebones readme
-rw-r--r--README.org40
1 files changed, 40 insertions, 0 deletions
diff --git a/README.org b/README.org
new file mode 100644
index 0000000..efd1ad6
--- /dev/null
+++ b/README.org
@@ -0,0 +1,40 @@
+* `petty-types`
+
+#+begin_src lisp
+
+> (typep (list 1 2 3 4) '(list-of real))
+T
+> (typep (list 1 2 3 4 3 2 1) '(list-of real))
+T
+> (typep (list 1 2 3 4) '(list-of real 4))
+T
+> (typep (list 1 2 #C(0 1)) '(list-of real))
+NIL
+> (typep (list 1 2 3 4) '(list-of real 5))
+NIL
+> (typep "aaabbb" '(vector-of (member #\a #\b)))
+T
+> (typep "aacabbb" '(vector-of (member #\a #\b)))
+NIL
+> (typep "aaabbb" '(vector-of (member #\a #\b) 6))
+T
+> (typep "aaaabbb" '(vector-of (member #\a #\b) 6))
+NIL
+> (typep "4aabbb" '(vector-of (member #\a #\b) 6))
+NIL
+> (typep "aabbba" '(vector-of (member #\a #\b) 6))
+T
+
+;; THIS IS ESPECIALLY ANNOYING:
+> (type-of "abab")
+(SIMPLE-ARRAY CHARACTER (4))
+> (typep "abab" '(simple-array (member #\a #\b) (4)))
+NIL
+
+;; but as above, VECTOR-OF works.
+> (typep "abab" '(vector-of (member #\a #\b) 4))
+T
+
+
+
+#+end_src