]> gitweb.factorcode.org Git - factor.git/commitdiff
factor: use new math.ranges syntax in tests and docs
authorDoug Coleman <doug.coleman@gmail.com>
Thu, 30 Dec 2021 03:18:16 +0000 (21:18 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Thu, 30 Dec 2021 03:18:16 +0000 (21:18 -0600)
20 files changed:
basis/bootstrap/assembler/ppc.32.linux.factor
basis/bootstrap/assembler/ppc.64.linux.factor
basis/bootstrap/assembler/ppc.factor
basis/calendar/calendar-tests.factor
basis/compiler/cfg/dominance/dominance-tests.factor
basis/cpu/ppc/ppc.factor
basis/html/templates/chloe/chloe-docs.factor
basis/images/tessellation/tessellation-tests.factor
basis/math/primes/erato/erato-tests.factor
basis/math/vectors/simd/simd-tests.factor
basis/persistent/hashtables/hashtables-tests.factor
basis/random/passwords/passwords.factor
basis/windows/user32/user32.factor
extra/backtrack/backtrack-docs.factor
extra/bittorrent/bittorrent.factor
extra/hashcash/hashcash.factor
extra/imap/imap-tests.factor
extra/math/factorials/factorials-tests.factor
extra/pcre/pcre-tests.factor
extra/trees/trees-tests.factor

index a9f55b6a160543bb829265d96d28a199bbd926a5..da83cef08dcc57fb89e4538fca414b55906ab4ec 100644 (file)
@@ -16,7 +16,7 @@ CONSTANT: rs-reg    15
 CONSTANT: vm-reg    16
 CONSTANT: ctx-reg   17
 CONSTANT: frame-reg 31
-: nv-int-regs ( -- seq ) 13 31 [a,b] ;
+: nv-int-regs ( -- seq ) 13 31 [a..b] ;
 
 : LOAD32 ( r n -- )
     [ -16 shift 0xffff bitand LIS ]
index 831b95b7eba552f8b098dc68c9347f40de2ab48b..9ec4d373737547ec2ebb7297b653307e805ee2df 100644 (file)
@@ -16,7 +16,7 @@ CONSTANT: rs-reg    15
 CONSTANT: vm-reg    16
 CONSTANT: ctx-reg   17
 CONSTANT: frame-reg 31
-: nv-int-regs ( -- seq ) 13 31 [a,b] ;
+: nv-int-regs ( -- seq ) 13 31 [a..b] ;
 
 : LOAD64 ( r n -- )
     [ dup ] dip {
index 09bbe19d57015a030152d54e539c8f0afe0969a4..3f45aba7f6fbc0eb7198726f726ae208f44c68be 100644 (file)
@@ -40,8 +40,8 @@ IN: bootstrap.ppc
 : restore-vec ( reg offt -- ) save-at 11 swap LI 11 1 LVXL ;
 
 ! Stop using intervals here.
-: nv-fp-regs  ( -- seq ) 14 31 [a,b] ;
-: nv-vec-regs ( -- seq ) 20 31 [a,b] ;
+: nv-fp-regs  ( -- seq ) 14 31 [a..b] ;
+: nv-vec-regs ( -- seq ) 20 31 [a..b] ;
 
 : saved-fp-regs-size  ( -- n ) 144 ;
 : saved-vec-regs-size ( -- n ) 192 ;
index 4127e122a92b6e860e78a225d6b99e454c3cac10..ec90ce8afb1c9e5817c7cab441f94954662273ac 100644 (file)
@@ -251,14 +251,14 @@ IN: calendar
 ] unit-test
 
 { t } [
-    1999 2025 [a,b] [
+    1999 2025 [a..b] [
         <year> timestamp>year-dates-gmt
         [ >date< ymd>ordinal ] map [ < ] monotonic?
     ] map [ ] all?
 ] unit-test
 
 { t } [
-    1999 2025 [a,b] [
+    1999 2025 [a..b] [
         <year-gmt> timestamp>year-dates-gmt
         [ >date< ymd>ordinal ] map [ < ] monotonic?
     ] map [ ] all?
index d963c961408b096602b08396b42b0ff02689b54a..66cb3211a87f83ec5a2d599d60dc37b99299ffbd 100644 (file)
@@ -52,7 +52,7 @@ V{ } 4 test-bb
 
 { } [ test-dominance ] unit-test
 
-{ t } [ 0 4 [a,b] [ get dom-parent 0 get eq? ] all? ] unit-test
+{ t } [ 0 4 [a..b] [ get dom-parent 0 get eq? ] all? ] unit-test
 
 ! The other example from the paper
 V{ } 0 test-bb
@@ -71,7 +71,7 @@ V{ } 5 test-bb
 
 { } [ test-dominance ] unit-test
 
-{ t } [ 0 5 [a,b] [ get dom-parent 0 get eq? ] all? ] unit-test
+{ t } [ 0 5 [a..b] [ get dom-parent 0 get eq? ] all? ] unit-test
 
 : non-det-test ( -- cfg )
     9 <iota> [ V{ } clone over insns>block ] { } map>assoc dup
index 7a78d3d981556216f29445b41b3681e6f78299a4..24d09fb8b3d3e150b478fea5060c746d9cb97265 100644 (file)
@@ -46,8 +46,8 @@ CONSTANT: vm-reg         16
 
 M: ppc machine-registers
     {
-        { int-regs $[ 3 12 [a,b] 17 29 [a,b] append ] }
-        { float-regs $[ 0 29 [a,b] ] }
+        { int-regs $[ 3 12 [a..b] 17 29 [a..b] append ] }
+        { float-regs $[ 0 29 [a..b] ] }
     } ;
 
 M: ppc frame-reg 31 ;
index c38cf0ac4c9c435c004c2fc87b004b9258129dd9..94b0a9c7d15da7d983c498900bda479fdc39cb3b 100644 (file)
@@ -256,7 +256,7 @@ $nl
     "    random-attrs string>random-generator"
     "    '["
     "        _ _ _"
-    "        [ [a,b] random present write ]"
+    "        [ [a..b] random present write ]"
     "        with-random-generator"
     "    ] [code] ;"
 }
index 74b9d1b14646d46f64d02d406338ff706d20fba3..211f5893eec6191098c3aae9e85af8e1cc61cd06 100644 (file)
@@ -20,7 +20,7 @@ IN: images.tessellation
     }
 } [
     <image>
-        1 16 [a,b] >byte-array >>bitmap
+        1 16 [a..b] >byte-array >>bitmap
         { 4 4 } >>dim
         L >>component-order
         ubyte-components >>component-type
@@ -40,7 +40,7 @@ IN: images.tessellation
     }
 } [
     <image>
-        1 9 [a,b] >byte-array >>bitmap
+        1 9 [a..b] >byte-array >>bitmap
         { 3 3 } >>dim
         L >>component-order
         ubyte-components >>component-type
index 96a2cfdb20da961f5132234efa13e168042cee0c..c68b35b655d6e14977b7ed88674813c5b93f4847 100644 (file)
@@ -13,7 +13,7 @@ math.ranges sequences tools.test ;
 ! Check sieve array length logic by making sure we get the right
 ! end-point for numbers with all possibilities mod 30. If something
 ! were to go wrong, we'd get a bounds-error.
-{ } [ 2 100 [a,b] [ dup sieve marked-prime? drop ] each ] unit-test
+{ } [ 2 100 [a..b] [ dup sieve marked-prime? drop ] each ] unit-test
 
 { t } [
     { 2 3 5 7 11 13 } 100 sieve '[ _ marked-prime? ] all?
index 9f4a17e64e5ee178b453961709d6c96e138bf65d..c137e372037679c406561d60d6ac54fb56d38d74 100644 (file)
@@ -481,7 +481,7 @@ simd-classes [
         _ [ [
             _ new
             [ [ length <iota> ] keep like ]
-            [ [ length dup dup + [a,b) ] keep like ] bi [ ] 2sequence
+            [ [ length dup dup + [a..b) ] keep like ] bi [ ] 2sequence
         ] dip '[ _ vshuffle2-elements ] ]
         [ = ] check-optimizer
     ] unit-test
index 9fcd4de9b9acff50cce9809841141e59736c9a2e..3f42003e89c46506cf963d62bf5dd58c8c7490bc 100644 (file)
@@ -82,7 +82,7 @@ M: hash-0-b hashcode* 2drop 0 ;
 
 : random-string ( -- str )
     1000000 random ;
-    ! [ CHAR: a CHAR: z [a,b] random ] "" replicate-as ;
+    ! [ CHAR: a CHAR: z [a..b] random ] "" replicate-as ;
 
 : random-assocs ( n -- hash phash )
     [ random-string ] replicate
index 44cd127efdc0340e80e002a0847e9e8b85afc954..61cc31c1881c0cbf9006cc71eaa8386236419e3f 100644 (file)
@@ -5,12 +5,12 @@ IN: random.passwords
 
 <PRIVATE
 
-CONSTANT: ascii-printable-charset $[ 33 126 [a,b] ]
+CONSTANT: ascii-printable-charset $[ 33 126 [a..b] ]
 CONSTANT: hex-charset "0123456789ABCDEF"
 CONSTANT: alphanum-charset $[
-    CHAR: 0 CHAR: 9 [a,b]
-    CHAR: a CHAR: z [a,b] append
-    CHAR: A CHAR: Z [a,b] append ]
+    CHAR: 0 CHAR: 9 [a..b]
+    CHAR: a CHAR: z [a..b] append
+    CHAR: A CHAR: Z [a..b] append ]
 
 PRIVATE>
 
index 06b9f284fbd7248c426e5364d3d3967ac371a7a6..641c1f06caa742d6fdad8123dba02a447d60e5d5 100644 (file)
@@ -2366,7 +2366,7 @@ FUNCTION: BOOL IsValidDpiAwarenessContext (
 )
 
 ! DPI_AWARENESS_CONTEXT experimentally:
-! USE: math.ranges -100 1000 [a,b] [ <alien> IsValidDpiAwarenessContext ] zip-with
+! USE: math.ranges -100 1000 [a..b] [ <alien> IsValidDpiAwarenessContext ] zip-with
 ! [ nip 0 > ] assoc-filter keys .
 ! { -5 -4 -3 -2 -1 17 18 34 273 529 785 }
 
index 573864ec347077e9cc360643cee6abf3a2ae5fe4..f4efda5a0b9c6431b801cc7f82517fda0c3b10dc 100644 (file)
@@ -21,7 +21,7 @@ $nl
         "    [ + 30 = ] [ 4 * swap 2 * + 74 = ] 2bi and ;"
         ""
         "["
-        "    1 30 [a,b] amb 1 30 [a,b] amb"
+        "    1 30 [a..b] amb 1 30 [a..b] amb"
         "    [ check must-be-true ] [ 2array ] 2bi"
         "] bag-of ."
         "V{ { 23 7 } }"
@@ -32,7 +32,7 @@ $nl
         "    [ + 30 = ] [ 4 * swap 2 * + 74 = ] 2bi and ;"
         ""
         "["
-        "    1 30 [a,b] amb 1 30 [a,b] amb"
+        "    1 30 [a..b] amb 1 30 [a..b] amb"
         "    2dup check must-be-true"
         "    \"%d chickens, %d cows\\n\" printf"
         "    t"
index 3f606fb43f880a3ba2bdba31076ae5e2db0cbf11..70e4158e7b7ccec9b0dd6a338b63e9dc45b47b24 100644 (file)
@@ -15,9 +15,9 @@ IN: bittorrent
 <<
 CONSTANT: ALPHANUMERIC $[
     [
-        CHAR: a CHAR: z [a,b] %
-        CHAR: A CHAR: Z [a,b] %
-        CHAR: 0 CHAR: 9 [a,b] %
+        CHAR: a CHAR: z [a..b] %
+        CHAR: A CHAR: Z [a..b] %
+        CHAR: 0 CHAR: 9 [a..b] %
         ".-_~" %
     ] { } make
 ]
index b0f7efc274b7ac42ba9f17eef3649ab81b4810b3..017cb4bcd0956edd21fe77dd543e6d4a43796b15 100644 (file)
@@ -25,7 +25,7 @@ IN: hashcash
 ! Random salt is formed by ascii characters
 ! between 33 and 126
 CONSTANT: available-chars $[
-    CHAR: : 33 126 [a,b] remove >byte-array
+    CHAR: : 33 126 [a..b] remove >byte-array
 ]
 
 PRIVATE>
index 41f160be04b80dde9759c213e0759d6cf4f6bc81..d9b7231c7b827f18afe3b9f7d4fa9a3ef715fb35 100644 (file)
@@ -7,7 +7,7 @@ FROM: pcre => findall ;
 IN: imap.tests
 
 : random-ascii ( n -- str )
-    [ CHAR: a CHAR: z [a,b] random ] "" replicate-as ;
+    [ CHAR: a CHAR: z [a..b] random ] "" replicate-as ;
 
 : make-mail ( from -- mail )
     now timestamp>rfc822 swap 10000 random
index dcfea2f5d18a0445b4e0e9f1dfd1225a652413e4..b2a06d8efac28b90676ab2979dea18b021a87e14 100644 (file)
@@ -14,7 +14,7 @@ USING: kernel math.factorials math.functions math.ranges sequences tools.test ;
         1/0. 1/105 1/0. -1/15 1/0. 1/3 1/0. -1 1/0.
         1 1 1 2 3 8 15 48 105 384 945 3840
     }
-} [ -10 10 [a,b] [ double-factorial ] map ] unit-test
+} [ -10 10 [a..b] [ double-factorial ] map ] unit-test
 
 { 1 } [ 10 10 factorial/ ] unit-test
 { 720 } [ 10 7 factorial/ ] unit-test
index 686d93e7724f87127f66dc810c56a1e42d37dc89..abadc761c0b60e42edb9c52ee27d86af2544ba12 100644 (file)
@@ -90,7 +90,7 @@ os unix? [ [ 10 ] [ PCRE_CONFIG_NEWLINE pcre-config ] unit-test ] when
 ] unit-test
 
 : long-string ( -- x )
-    10000 [ CHAR: a CHAR: z [a,b] random ] "" replicate-as ;
+    10000 [ CHAR: a CHAR: z [a..b] random ] "" replicate-as ;
 
 ! Performance
 { 0 } [ long-string ".{0,15}foobar.{0,10}" findall length ] unit-test
index fa1768aadcb8b90f9dfd6720a146e0a35bab5f62..4a989406ac70c93072f5ab7a05554c77571ba142 100644 (file)
@@ -113,22 +113,22 @@ CONSTANT: test-tree2 TREE{
 
 { f } [ 99 test-tree2 lower-node ]  unit-test
 { f } [ 100 test-tree2 lower-node ]  unit-test
-100 121 (a,b] [
+100 121 (a..b] [
     [ test-tree2-lower-key 1array ] keep [ test-tree2 lower-node key>> ] curry unit-test
 ] each
 
-99 120 [a,b) [
+99 120 [a..b) [
     [ test-tree2-higher-key 1array ] keep [ test-tree2 higher-node key>> ] curry unit-test
 ] each
 { f } [ 120 test-tree2 higher-node ]  unit-test
 { f } [ 121 test-tree2 higher-node ]  unit-test
 
 { f } [ 99 test-tree2 floor-node ]  unit-test
-100 121 [a,b] [
+100 121 [a..b] [
     [ test-tree2-floor-key 1array ] keep [ test-tree2 floor-node key>> ] curry unit-test
 ] each
 
-99 120 [a,b] [
+99 120 [a..b] [
     [ test-tree2-ceiling-key 1array ] keep [ test-tree2 ceiling-node key>> ] curry unit-test
 ] each
 { f } [ 121 test-tree2 ceiling-node ]  unit-test
@@ -164,10 +164,10 @@ CONSTANT: test-tree2 TREE{
 
 : ?a,b? ( a b ? ? -- range )
     2array {
-        { { t t } [ [a,b] ] }
-        { { t f } [ [a,b) ] }
-        { { f t } [ (a,b] ] }
-        { { f f } [ (a,b) ] }
+        { { t t } [ [a..b] ] }
+        { { t f } [ [a..b) ] }
+        { { f t } [ (a..b] ] }
+        { { f f } [ (a..b) ] }
     } case ;
 
 ! subtree>alist
@@ -182,7 +182,7 @@ CONSTANT: test-tree2 TREE{
         { { f f } [ subtree>alist() ] }
     } case ;
 
-99 121 [a,b] 2 all-combinations
+99 121 [a..b] 2 all-combinations
 { t f } dup 2array <product-sequence> 2array
 [ first2 [ first2 ] bi@
     {