git.fiddlerwoaroof.com
Browse code

feat: add of-type to generate semipredicates

Edward Langley authored on 15/07/2023 17:11:11
Showing 1 changed files
... ...
@@ -193,6 +193,11 @@
193 193
         (alexandria:ends-with-subseq suffix
194 194
                                      it))))
195 195
 
196
+(defun of-type (type)
197
+  (lambda (it)
198
+    (when (typep it type)
199
+      it)))
200
+
196 201
 (defun transform-head (fun)
197 202
   (lambda (it)
198 203
     (typecase it