]> gitweb.factorcode.org Git - factor.git/commitdiff
left-trim -> trim-left
authorDoug Coleman <doug.coleman@gmail.com>
Fri, 5 Sep 2008 23:56:57 +0000 (18:56 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Fri, 5 Sep 2008 23:56:57 +0000 (18:56 -0500)
extra/math/polynomials/polynomials.factor
extra/pack/pack.factor
extra/parser-combinators/parser-combinators.factor
extra/project-euler/059/059.factor
extra/soundex/soundex.factor
extra/tar/tar.factor

index e3adf2277d1b9cf609b9c9f84b3db67092089610..1883f5692982a02ccc3096e1cc7828dbf3627ddf 100644 (file)
@@ -22,7 +22,7 @@ PRIVATE>
 : p= ( p p -- ? ) pextend = ;
 
 : ptrim ( p -- p )
-    dup length 1 = [ [ zero? ] right-trim ] unless ;
+    dup length 1 = [ [ zero? ] trim-right ] unless ;
 
 : 2ptrim ( p p -- p p ) [ ptrim ] bi@ ;
 : p+ ( p p -- p ) pextend v+ ;
index ed2756bb80aa881e11216adfe15bd02c9be721be..0bd4302fd708ad600d776a032411acf42e7fb574 100755 (executable)
@@ -84,7 +84,7 @@ M: string b, ( n string -- ) heap-size b, ;
     "\0" read-until [ drop f ] unless ;
 
 : read-c-string* ( n -- str/f )
-    read [ zero? ] right-trim dup empty? [ drop f ] when ;
+    read [ zero? ] trim-right dup empty? [ drop f ] when ;
 
 : (read-128-ber) ( n -- n )
     read1
index da723bae9d866e148c282d70758536c51cdd0028..0ee91bc326bbfb325c61ef8b6c234a4e712d22c0 100755 (executable)
@@ -175,11 +175,11 @@ M: or-parser parse ( input parser1 -- list )
     parsers>> 0 swap seq>list
     [ parse ] lazy-map-with lconcat ;
 
-: left-trim-slice ( string -- string )
+: trim-left-slice ( string -- string )
     #! Return a new string without any leading whitespace
     #! from the original string.
     dup empty? [
-        dup first blank? [ rest-slice left-trim-slice ] when
+        dup first blank? [ rest-slice trim-left-slice ] when
     ] unless ;
 
 TUPLE: sp-parser p1 ;
@@ -191,7 +191,7 @@ C: sp sp-parser ( p1 -- parser )
 M: sp-parser parse ( input parser -- list )
     #! Skip all leading whitespace from the input then call
     #! the parser on the remaining input.
-    >r left-trim-slice r> p1>> parse ;
+    >r trim-left-slice r> p1>> parse ;
 
 TUPLE: just-parser p1 ;
 
index 7cc6df3525670b9087a7b6ba50afdbc9222bdaa7..aa2cdb75b0000179ee876e71ee652a1e6cfdfd94 100644 (file)
@@ -53,7 +53,7 @@ IN: project-euler.059
 
 : source-059 ( -- seq )
     "resource:extra/project-euler/059/cipher1.txt"
-    ascii file-contents [ blank? ] right-trim "," split
+    ascii file-contents [ blank? ] trim-right "," split
     [ string>number ] map ;
 
 TUPLE: rollover seq n ;
index 23d5ee4d4cc2b60e892004c34c009e099fa019f7..d0da0b1347912ab055d6df33f05a323b51d0af09 100644 (file)
@@ -15,7 +15,7 @@ TR: soundex-tr
     [ 2 <clumps> [ = not ] assoc-filter values ] [ first ] bi prefix ;
 
 : first>upper ( seq -- seq' ) 1 head >upper ;
-: trim-first ( seq -- seq' ) dup first [ = ] curry left-trim ;
+: trim-first ( seq -- seq' ) dup first [ = ] curry trim-left ;
 : remove-zeroes ( seq -- seq' ) CHAR: 0 swap remove ;
 : remove-non-alpha ( seq -- seq' ) [ alpha? ] filter ;
 : pad-4 ( first seq -- seq' ) "000" 3append 4 head ;
index 28913d71416901c5192af342698111cf1b147a0c..286ac0183a0d2398b7fc9486a7f0cf78b6447cb5 100755 (executable)
@@ -135,7 +135,7 @@ M: unknown-typeflag summary ( obj -- str )
 : typeflag-L ( header -- )
     drop ;
     ! <string-writer> [ read-data-blocks ] keep
-    ! >string [ zero? ] right-trim filename set
+    ! >string [ zero? ] trim-right filename set
     ! filename get tar-prepend-path make-directories ;
 
 ! Multi volume continuation entry