diff --git a/core/assocs/assocs.factor b/core/assocs/assocs.factor index 5079420b54..4dc3702c18 100644 --- a/core/assocs/assocs.factor +++ b/core/assocs/assocs.factor @@ -43,7 +43,7 @@ M: assoc assoc-find inline : assoc-push-if ( key value quot accum -- ) - >r 2over 2slip r> roll + >r 2keep r> roll [ >r 2array r> push ] [ 3drop ] if ; inline : assoc-pusher ( quot -- quot' accum ) @@ -53,7 +53,7 @@ M: assoc assoc-find over >r assoc-pusher >r assoc-each r> r> assoc-like ; inline : assoc-all? ( assoc quot -- ? ) - [ not ] compose assoc-find 2nip not ; inline + [ not ] compose assoc-contains? not ; inline : assoc-contains? ( assoc quot -- ? ) assoc-find 2nip ; inline diff --git a/core/threads/threads.factor b/core/threads/threads.factor index 7a67d1b531..ee136654df 100644 --- a/core/threads/threads.factor +++ b/core/threads/threads.factor @@ -32,7 +32,7 @@ PRIVATE> : stop ( -- ) walker-hook [ - f swap continue-with + continue ] [ run-queue pop-back dup array? [ first2 continue-with ] [ continue ] if diff --git a/core/vocabs/vocabs.factor b/core/vocabs/vocabs.factor index 910410c84c..8db65e2eac 100755 --- a/core/vocabs/vocabs.factor +++ b/core/vocabs/vocabs.factor @@ -102,7 +102,7 @@ M: vocab-link vocab-name vocab-link-name ; UNION: vocab-spec vocab vocab-link ; : forget-vocab ( vocab -- ) - dup vocab-words values forget-all + dup words forget-all vocab-name dictionary get delete-at ; M: vocab-spec forget* forget-vocab ; diff --git a/extra/benchmark/nsieve-bits/nsieve-bits.factor b/extra/benchmark/nsieve-bits/nsieve-bits.factor index 46ebc6595e..fe70246cb5 100644 --- a/extra/benchmark/nsieve-bits/nsieve-bits.factor +++ b/extra/benchmark/nsieve-bits/nsieve-bits.factor @@ -28,7 +28,7 @@ bit-arrays namespaces io ; : nsieve-bits-main ( n -- ) dup 2^ 10000 * nsieve-bits. - dup 1 - 2^ 10000 * nsieve-bits. + dup 1- 2^ 10000 * nsieve-bits. 2 - 2^ 10000 * nsieve-bits. ; : nsieve-bits-main* 11 nsieve-bits-main ; diff --git a/extra/calendar/calendar.factor b/extra/calendar/calendar.factor index 4e473279fa..c9b62ce7aa 100755 --- a/extra/calendar/calendar.factor +++ b/extra/calendar/calendar.factor @@ -96,12 +96,12 @@ SYMBOL: m : zero-dt ( --
) 0 0 0 0 0 0
; : years ( n -- dt ) zero-dt [ set-dt-year ] keep ; : months ( n -- dt ) zero-dt [ set-dt-month ] keep ; -: weeks ( n -- dt ) 7 * zero-dt [ set-dt-day ] keep ; : days ( n -- dt ) zero-dt [ set-dt-day ] keep ; +: weeks ( n -- dt ) 7 * days ; : hours ( n -- dt ) zero-dt [ set-dt-hour ] keep ; : minutes ( n -- dt ) zero-dt [ set-dt-minute ] keep ; : seconds ( n -- dt ) zero-dt [ set-dt-second ] keep ; -: milliseconds ( n -- dt ) 1000 /f zero-dt [ set-dt-second ] keep ; +: milliseconds ( n -- dt ) 1000 /f seconds ; : julian-day-number>timestamp ( n -- timestamp ) julian-day-number>date 0 0 0 0 ; @@ -259,10 +259,7 @@ M: timestamp <=> ( ts1 ts2 -- n ) 1+ + 7 mod ; : day-of-week ( timestamp -- n ) - [ timestamp-year ] keep - [ timestamp-month ] keep - timestamp-day - zeller-congruence ; + >date< zeller-congruence ; : day-of-year ( timestamp -- n ) [ diff --git a/extra/crypto/common/common.factor b/extra/crypto/common/common.factor index e98f0cd959..3ac551d114 100644 --- a/extra/crypto/common/common.factor +++ b/extra/crypto/common/common.factor @@ -40,7 +40,7 @@ SYMBOL: big-endian? ] "" make 64 group ; : shift-mod ( n s w -- n ) - >r shift r> 1 swap shift 1 - bitand ; inline + >r shift r> 2^ 1- bitand ; inline : update-old-new ( old new -- ) [ get >r get r> ] 2keep >r >r w+ dup r> set r> set ; inline diff --git a/extra/http/client/client.factor b/extra/http/client/client.factor index 08c5185cd2..f117a4fda1 100644 --- a/extra/http/client/client.factor +++ b/extra/http/client/client.factor @@ -29,7 +29,7 @@ IN: http.client : crlf "\r\n" write ; : http-request ( host resource method -- ) - write " " write write " HTTP/1.0" write crlf + write bl write " HTTP/1.0" write crlf "Host: " write write crlf ; : get-request ( host resource -- ) diff --git a/extra/math/miller-rabin/miller-rabin.factor b/extra/math/miller-rabin/miller-rabin.factor index 4f139e38e6..5e8b9d8285 100644 --- a/extra/math/miller-rabin/miller-rabin.factor +++ b/extra/math/miller-rabin/miller-rabin.factor @@ -77,7 +77,7 @@ TUPLE: miller-rabin-bounds ; >odd (find-relative-prime) ; : find-relative-prime ( n -- p ) - dup random >odd (find-relative-prime) ; + dup random (find-relative-prime*) ; : unique-primes ( numbits n -- seq ) #! generate two primes