]> gitweb.factorcode.org Git - factor.git/commitdiff
regexp.classes: rename substitute to (substitute).
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 18 Mar 2021 19:16:52 +0000 (12:16 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 18 Mar 2021 19:16:52 +0000 (12:16 -0700)
basis/regexp/classes/classes.factor

index 464f8c03de66b5f0d5238a651440236c77017c05..7cce32ecfa81c6b589da36531f88393ce2b753e7 100644 (file)
@@ -141,7 +141,7 @@ TUPLE: and-class { seq read-only } ;
 M: and-class class-member?
     seq>> [ class-member? ] with all? ; inline
 
-DEFER: substitute
+DEFER: (substitute)
 
 : flatten ( seq class -- newseq )
     '[ dup _ instance? [ seq>> ] [ 1array ] if ] map concat ; inline
@@ -188,7 +188,7 @@ TUPLE: class-partition integers not-integers simples not-simples and or other ;
 
 : answer-ors ( partition -- partition' )
     dup [ not-integers>> ] [ not-simples>> ] [ simples>> ] tri 3append
-    '[ [ _ [ t substitute ] each ] map ] change-or ;
+    '[ [ _ [ t (substitute) ] each ] map ] change-or ;
 
 : contradiction? ( partition -- ? )
     {
@@ -219,7 +219,7 @@ TUPLE: class-partition integers not-integers simples not-simples and or other ;
 
 : answer-ands ( partition -- partition' )
     dup [ integers>> ] [ not-simples>> ] [ simples>> ] tri 3append
-    '[ [ _ [ f substitute ] each ] map ] change-and ;
+    '[ [ _ [ f (substitute) ] each ] map ] change-and ;
 
 : tautology? ( partition -- ? )
     {
@@ -291,12 +291,12 @@ M: or-class answer
 M: not-class answer
     [ class>> ] 2dip answer <not-class> ;
 
-GENERIC#: substitute 1 ( class from to -- new-class )
-M: object substitute answer ;
-M: not-class substitute [ <not-class> ] bi@ answer ;
+GENERIC#: (substitute) 1 ( class from to -- new-class )
+M: object (substitute) answer ;
+M: not-class (substitute) [ <not-class> ] bi@ answer ;
 
 : assoc-answer ( table question answer -- new-table )
-    '[ _ _ substitute ] assoc-map sift-values ;
+    '[ _ _ (substitute) ] assoc-map sift-values ;
 
 : assoc-answers ( table questions answer -- new-table )
     '[ _ assoc-answer ] each ;