Browse files

added some patterns for types

  • Loading branch information...
1 parent 4c66e56 commit c3875efb4b8f8cc68f42205eb408f6c731a62b15 @VincentToups committed Sep 9, 2012
Showing with 19 additions and 0 deletions.
  1. +19 −0 shadchen.el
View
19 shadchen.el
@@ -1068,6 +1068,25 @@ the matching expression from the body."
(shadchen:enumerate-substrings ,-string- ,(length patterns)))
(one-of (list ,@patterns))))))
+(defun shadchen:non-keyword-symbolp (o)
+ (and (symbolp o)
+ (not (keywordp o))))
+
+(defpattern keyword (pattern)
+ `(p #'keywordp ,pattern))
+
+(defpattern symbol (pattern)
+ `(p #'symbolp ,pattern))
+
+(defpattern non-kw-symbol (pattern)
+ `(p #'shadchen:non-keyword-symbolp ,pattern))
+
+(defpattern string (pattern)
+ `(p #'stringp ,pattern))
+
+(defpattern number (pattern)
+ `(p #'numberp ,pattern))
+
(provide 'shadchen)

0 comments on commit c3875ef

Please sign in to comment.