]> gitweb.factorcode.org Git - factor.git/commitdiff
Cleanups found with lint tool
authorDoug Coleman <doug.coleman@gmail.com>
Fri, 14 Oct 2011 17:14:41 +0000 (10:14 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Fri, 14 Oct 2011 17:15:13 +0000 (10:15 -0700)
basis/calendar/calendar.factor
basis/calendar/format/format.factor
basis/core-foundation/time/time.factor
basis/sequences/generalizations/generalizations.factor
basis/unicode/case/case-tests.factor
basis/unicode/case/case.factor

index 85a1c72d110bf5a5f476e9318a077bcd01dd1502..7e9512d04694bec6443b2e1a25ae6092328131a9 100644 (file)
@@ -33,19 +33,19 @@ TUPLE: timestamp
 C: <timestamp> timestamp
 
 : gmt-offset-duration ( -- duration )
-    0 0 0 gmt-offset <duration> ;
+    0 0 0 gmt-offset <duration> ; inline
 
 : <date> ( year month day -- timestamp )
-    0 0 0 gmt-offset-duration <timestamp> ;
+    0 0 0 gmt-offset-duration <timestamp> ; inline
 
 : <date-gmt> ( year month day -- timestamp )
-    0 0 0 instant <timestamp> ;
+    0 0 0 instant <timestamp> ; inline
 
 : <year> ( year -- timestamp )
-    1 1 <date> ;
+    1 1 <date> ; inline
 
 : <year-gmt> ( year -- timestamp )
-    1 1 <date-gmt> ;
+    1 1 <date-gmt> ; inline
 
 ERROR: not-a-month ;
 M: not-a-month summary
@@ -352,14 +352,14 @@ M: duration time-
     before time+ ;
 
 : <zero> ( -- timestamp )
-    0 0 0 0 0 0 instant <timestamp> ;
+    0 0 0 <date-gmt> ; inline
 
 : valid-timestamp? ( timestamp -- ? )
     clone instant >>gmt-offset
     dup <zero> time- <zero> time+ = ;
 
 : unix-1970 ( -- timestamp )
-    1970 1 1 0 0 0 instant <timestamp> ;
+    1970 <year-gmt> ; inline
 
 : millis>timestamp ( x -- timestamp )
     [ unix-1970 ] dip milliseconds time+ ;
@@ -529,16 +529,16 @@ M: timestamp end-of-year 12 >>month 31 >>day ;
 M: integer end-of-year 12 31 <date> ;
 
 : time-since-midnight ( timestamp -- duration )
-    dup midnight time- ;
+    dup midnight time- ; inline
 
 : since-1970 ( duration -- timestamp )
-    unix-1970 time+ ;
+    unix-1970 time+ ; inline
 
 : timestamp>unix-time ( timestamp -- seconds )
-    unix-1970 time- second>> ;
+    unix-1970 time- second>> ; inline
 
 : unix-time>timestamp ( seconds -- timestamp )
-    seconds unix-1970 time+ ;
+    seconds since-1970 ; inline
 
 {
     { [ os unix? ] [ "calendar.unix" ] }
index 35e364e6aafe1a746469728bddf160c2a5c25c20..ac2e902c86a82d4fc650284594ddec94bf56ac15 100644 (file)
@@ -205,7 +205,7 @@ ERROR: invalid-timestamp-format ;
         read-sp checked-number >>year\r
         ":" read-token checked-number >>hour\r
         ":" read-token checked-number >>minute\r
-        " " read-token checked-number >>second\r
+        read-sp checked-number >>second\r
         readln parse-rfc822-gmt-offset >>gmt-offset ;\r
 \r
 : rfc822>timestamp ( str -- timestamp )\r
@@ -224,7 +224,7 @@ ERROR: invalid-timestamp-format ;
         read-sp checked-number >>year\r
         ":" read-token checked-number >>hour\r
         ":" read-token checked-number >>minute\r
-        " " read-token checked-number >>second\r
+        read-sp checked-number >>second\r
         readln parse-rfc822-gmt-offset >>gmt-offset ;\r
 \r
 : cookie-string>timestamp-1 ( str -- timestamp )\r
@@ -237,7 +237,7 @@ ERROR: invalid-timestamp-format ;
         read-sp checked-number >>day\r
         ":" read-token checked-number >>hour\r
         ":" read-token checked-number >>minute\r
-        " " read-token checked-number >>second\r
+        read-sp checked-number >>second\r
         read-sp checked-number >>year\r
         readln parse-rfc822-gmt-offset >>gmt-offset ;\r
 \r
index 59dd8098b484070af859441d5a191d513af1a1b8..37c4ff5d0e5e78e303431a10cd8423d92365d1dd 100644 (file)
@@ -6,8 +6,7 @@ IN: core-foundation.time
 TYPEDEF: double CFTimeInterval
 TYPEDEF: double CFAbsoluteTime
 
-: >CFTimeInterval ( duration -- interval )
-    duration>seconds ; inline
+ALIAS: >CFTimeInterval duration>seconds
 
 MEMO: epoch ( -- micros )
     T{ timestamp { year 2001 } { month 1 } { day 1 } } timestamp>micros ;
index 8401930db398ce4d683e7b4923c0a949900a9dfb..59eceb3375662bd77affb937535cdb70a0469846 100644 (file)
@@ -33,11 +33,11 @@ MACRO: set-firstn ( n -- )
         bi-curry '[ _ _ bi ]
     ] if ;
 
-: nappend-as ( n exemplar -- seq )
-    [ narray concat ] dip like ; inline
-
 : nappend ( n -- seq ) narray concat ; inline
 
+: nappend-as ( n exemplar -- seq )
+    [ nappend ] dip like ; inline
+
 MACRO: nmin-length ( n -- )
     dup 1 - [ min ] n*quot
     '[ [ length ] _ napply @ ] ;
index 9344d1102ef20ad93793153de4bd087a4e3f45d6..76fe0088e8743e1273ee5cd89ffa6a7dc320bff1 100644 (file)
@@ -10,16 +10,16 @@ IN: unicode.case.tests
 [ t ] [ "hello how are you?" lower? ] unit-test
 [
     [ f ] [ i-dot? ] unit-test
-    [ f ] [ lt? ] unit-test
+    [ f ] [ lithuanian? ] unit-test
     "tr" locale set
     [ t ] [ i-dot? ] unit-test
-    [ f ] [ lt? ] unit-test
+    [ f ] [ lithuanian? ] unit-test
     [ "i\u000131i \u000131jj" ] [ "i\u000131I\u000307 IJj" >lower ] unit-test
     [ "I\u000307\u000131i Ijj" ] [ "i\u000131I\u000307 IJj" >title ] unit-test
     [ "I\u000307II\u000307 IJJ" ] [ "i\u000131I\u000307 IJj" >upper ] unit-test
     "lt" locale set
     [ f ] [ i-dot? ] unit-test
-    [ t ] [ lt? ] unit-test
+    [ t ] [ lithuanian? ] unit-test
     [ "i\u000307\u000300" ] [ HEX: CC 1string nfd >lower ] unit-test
     [ "\u00012f\u000307" ] [ HEX: 12E 1string nfd >lower nfc ] unit-test
     [ "I\u000300" ] [ "i\u000307\u000300" >upper ] unit-test
index fc4445378a1fea5bce05a3c9ef6f94b6a98ac429..e68bf656afce4e0e88d7287b5c113e7d97657b79 100644 (file)
@@ -20,9 +20,6 @@ SYMBOL: locale ! Just casing locale, or overall?
 : i-dot? ( -- ? )
     locale get { "tr" "az" } member? ;
 
-: lt? ( -- ? )
-    locale get "lt" = ;
-
 : lithuanian? ( -- ? ) locale get "lt" = ;
 
 : lithuanian>upper ( string -- lower )
@@ -87,7 +84,7 @@ PRIVATE>
 
 : >lower ( string -- lower )
     i-dot? [ turk>lower ] when
-    lt? [ lithuanian>lower ] when
+    lithuanian? [ lithuanian>lower ] when
     final-sigma
     [ lower>> ] [ ch>lower ] map-case ;
 
@@ -95,7 +92,7 @@ HINTS: >lower string ;
 
 : >upper ( string -- upper )
     i-dot? [ turk>upper ] when
-    lt? [ lithuanian>upper ] when
+    lithuanian? [ lithuanian>upper ] when
     [ upper>> ] [ ch>upper ] map-case ;
 
 HINTS: >upper string ;
@@ -104,7 +101,7 @@ HINTS: >upper string ;
 
 : (>title) ( string -- title )
     i-dot? [ turk>upper ] when
-    lt? [ lithuanian>upper ] when
+    lithuanian? [ lithuanian>upper ] when
     [ title>> ] [ ch>title ] map-case ; inline
 
 PRIVATE>