diff --git a/basis/calendar/calendar.factor b/basis/calendar/calendar.factor index 85a1c72d11..7e9512d046 100644 --- a/basis/calendar/calendar.factor +++ b/basis/calendar/calendar.factor @@ -33,19 +33,19 @@ TUPLE: timestamp C: timestamp : gmt-offset-duration ( -- duration ) - 0 0 0 gmt-offset ; + 0 0 0 gmt-offset ; inline : ( year month day -- timestamp ) - 0 0 0 gmt-offset-duration ; + 0 0 0 gmt-offset-duration ; inline : ( year month day -- timestamp ) - 0 0 0 instant ; + 0 0 0 instant ; inline : ( year -- timestamp ) - 1 1 ; + 1 1 ; inline : ( year -- timestamp ) - 1 1 ; + 1 1 ; inline ERROR: not-a-month ; M: not-a-month summary @@ -352,14 +352,14 @@ M: duration time- before time+ ; : ( -- timestamp ) - 0 0 0 0 0 0 instant ; + 0 0 0 ; inline : valid-timestamp? ( timestamp -- ? ) clone instant >>gmt-offset dup time- time+ = ; : unix-1970 ( -- timestamp ) - 1970 1 1 0 0 0 instant ; + 1970 ; 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 ; : 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" ] } diff --git a/basis/calendar/format/format.factor b/basis/calendar/format/format.factor index 35e364e6aa..ac2e902c86 100644 --- a/basis/calendar/format/format.factor +++ b/basis/calendar/format/format.factor @@ -205,7 +205,7 @@ ERROR: invalid-timestamp-format ; read-sp checked-number >>year ":" read-token checked-number >>hour ":" read-token checked-number >>minute - " " read-token checked-number >>second + read-sp checked-number >>second readln parse-rfc822-gmt-offset >>gmt-offset ; : rfc822>timestamp ( str -- timestamp ) @@ -224,7 +224,7 @@ ERROR: invalid-timestamp-format ; read-sp checked-number >>year ":" read-token checked-number >>hour ":" read-token checked-number >>minute - " " read-token checked-number >>second + read-sp checked-number >>second readln parse-rfc822-gmt-offset >>gmt-offset ; : cookie-string>timestamp-1 ( str -- timestamp ) @@ -237,7 +237,7 @@ ERROR: invalid-timestamp-format ; read-sp checked-number >>day ":" read-token checked-number >>hour ":" read-token checked-number >>minute - " " read-token checked-number >>second + read-sp checked-number >>second read-sp checked-number >>year readln parse-rfc822-gmt-offset >>gmt-offset ; diff --git a/basis/core-foundation/time/time.factor b/basis/core-foundation/time/time.factor index 59dd8098b4..37c4ff5d0e 100644 --- a/basis/core-foundation/time/time.factor +++ b/basis/core-foundation/time/time.factor @@ -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 ; diff --git a/basis/sequences/generalizations/generalizations.factor b/basis/sequences/generalizations/generalizations.factor index 8401930db3..59eceb3375 100644 --- a/basis/sequences/generalizations/generalizations.factor +++ b/basis/sequences/generalizations/generalizations.factor @@ -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 @ ] ; diff --git a/basis/unicode/case/case-tests.factor b/basis/unicode/case/case-tests.factor index 9344d1102e..76fe0088e8 100644 --- a/basis/unicode/case/case-tests.factor +++ b/basis/unicode/case/case-tests.factor @@ -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 diff --git a/basis/unicode/case/case.factor b/basis/unicode/case/case.factor index fc4445378a..e68bf656af 100644 --- a/basis/unicode/case/case.factor +++ b/basis/unicode/case/case.factor @@ -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>