]> gitweb.factorcode.org Git - factor.git/commitdiff
factor: Final rename of ranges words and fix up some using lists
authorDoug Coleman <doug.coleman@gmail.com>
Thu, 30 Dec 2021 19:48:08 +0000 (13:48 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Thu, 30 Dec 2021 19:48:08 +0000 (13:48 -0600)
13 files changed:
README.md
basis/calendar/calendar-tests.factor
basis/cbor/cbor-tests.factor
basis/math/functions/functions-tests.factor
core/math/floats/floats.factor
core/math/parser/parser.factor
core/sequences/sequences-docs.factor
extra/brainfuck/brainfuck-tests.factor
extra/math/extras/extras-tests.factor
extra/picomath/picomath-tests.factor
extra/sequences/extras/extras-docs.factor
extra/text-to-pdf/text-to-pdf.pdf
extra/websites/factorcode/examples.txt

index c127539d690d43c3bc290152b0ec5085ae6cf277..94db2d9d2c425ed50017f8d8084768129717befa 100644 (file)
--- a/README.md
+++ b/README.md
@@ -80,7 +80,7 @@ Some other simple things you can try in the listener:
 
 { 4 8 15 16 23 42 } [ 2 * ] map .
 
-1000 [1,b] sum .
+1000 [1..b] sum .
 
 4 <iota> [
     "Happy Birthday " write
index 056def163e9ebf09683052ab9a7dba12ca85d457..a3a5772d89b559dd364e1590979856664e06caba 100644 (file)
@@ -208,7 +208,7 @@ IN: calendar
 ] unit-test
 
 { { 1 1 1 2 2 2 3 3 3 4 4 4 } } [
-    12 [1,b] [ 2020 swap 1 <date> quarter ] map
+    12 [1..b] [ 2020 swap 1 <date> quarter ] map
 ] unit-test
 
 { 0 }
index 0d356f3297762efe536c2c552d0dadf0bb58004d..2e933787534b78368b35fd3bc210772ed81d8862 100644 (file)
@@ -77,7 +77,7 @@ math.parser ranges tools.test urls ;
     { { } "80" }
     { { 1 2 3 } "83010203" }
     { { 1 { 2 3 } { 4 5 } } "8301820203820405" }
-    ${ 25 [1,b] >array "98190102030405060708090a0b0c0d0e0f101112131415161718181819" }
+    ${ 25 [1..b] >array "98190102030405060708090a0b0c0d0e0f101112131415161718181819" }
     { { } "a0" }
     { { { 1 2 } { 3 4 } } "a201020304" }
     { { { "a" 1 } { "b" { 2 3 } } } "a26161016162820203" }
@@ -90,7 +90,7 @@ math.parser ranges tools.test urls ;
     { { 1 { 2 3 } { 4 5 } } "9f01820203820405ff" }
     { { 1 { 2 3 } { 4 5 } } "83018202039f0405ff" }
     { { 1 { 2 3 } { 4 5 } } "83019f0203ff820405" }
-    ${ 25 [1,b] >array "9f0102030405060708090a0b0c0d0e0f101112131415161718181819ff" }
+    ${ 25 [1..b] >array "9f0102030405060708090a0b0c0d0e0f101112131415161718181819ff" }
     { { { "a" 1 } { "b" { 2 3 } } } "bf61610161629f0203ffff" }
     { { "a" { { "b" "c" } } } "826161bf61626163ff" }
     { { { "Fun" t } { "Amt" -2 } } "bf6346756ef563416d7421ff" }
index dcba10e60968b8f46f1cc9fa829da8473b6f5987..8be020883f11dc8b6df01a17e09211326c1dc461 100644 (file)
@@ -38,7 +38,7 @@ IN: math.functions.tests
 { 0 } [ 0 3.0 ^ ] unit-test
 { 0 } [ 0 3 ^ ] unit-test
 
-: factorial ( n -- n! ) [ 1 ] [ [1,b] 1 [ * ] reduce ] if-zero ;
+: factorial ( n -- n! ) [ 1 ] [ [1..b] 1 [ * ] reduce ] if-zero ;
 
 { 0.0 0 } [ 0 frexp ] unit-test
 { 0.5 1 } [ 1 frexp ] unit-test
index c5882724f4da4a2aca7a1f94e6a6b590d0ba8242..509e42e36e00cf1cf2bc3470232008fd535637ae 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2004, 2010 Slava Pestov, Joe Groff.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: kernel math math.private math.order ;
+USING: kernel math math.order math.private ;
 IN: math.floats
 
 <PRIVATE
index 34e779a876116beddb9adb38dcd8fef04576317c..93c139a19c8f079a390ff853f91077262e18cfad 100644 (file)
@@ -1,7 +1,8 @@
 ! Copyright (C) 2009 Joe Groff, 2013 John Benediktsson
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors byte-arrays combinators kernel kernel.private layouts
-make math math.private sbufs sequences sequences.private strings ;
+USING: accessors byte-arrays combinators kernel kernel.private
+layouts make math math.private sbufs sequences sequences.private
+strings ;
 IN: math.parser
 
 <PRIVATE
index ff4e297c78037dab1323af075acf5f4ce4f53291..74e437ded3773be5a638fd2b2a7279bd74222fc8 100644 (file)
@@ -1280,7 +1280,7 @@ HELP: map-sum
 { $examples
     { $example
         "USING: math ranges sequences prettyprint ;"
-        "100 [1,b] [ sq ] map-sum ."
+        "100 [1..b] [ sq ] map-sum ."
         "338350"
     }
 } ;
@@ -1291,7 +1291,7 @@ HELP: count
 { $examples
     { $example
         "USING: math ranges sequences prettyprint ;"
-        "100 [1,b] [ even? ] count ."
+        "100 [1..b] [ even? ] count ."
         "50"
     }
 } ;
index c377f2e80cde077e33b67c6a424d04fecd78ab77..44fc251e7fd811a6d564a9dd9fa4b40b6022fe14 100644 (file)
@@ -67,7 +67,7 @@ math.parser ranges sequences splitting tools.test ;
 
 ! Squares of numbers from 0 to 100
 
-${ 100 [0,b] [ dup * number>string ] map join-lines "\n" append }
+${ 100 [0..b] [ dup * number>string ] map join-lines "\n" append }
 [
     "
     ++++[>+++++<-]>[<+++++>-]+<+[
index b5dbbbd9beb4caf55f9712b8363835d57cb92cfa..88240eb03ae9c6f13c06c4daf6e31d4906f44693 100644 (file)
@@ -15,14 +15,14 @@ tools.test ;
 { -1 } [ 127 703 jacobi ] unit-test
 { 1 } [ -4 197 jacobi ] unit-test
 
-{ { 2 3 4 5 6 7 8 9 } } [ 10 [1,b] 3 moving-average ] unit-test
+{ { 2 3 4 5 6 7 8 9 } } [ 10 [1..b] 3 moving-average ] unit-test
 { { 1+1/2 2+1/2 3+1/2 4+1/2 5+1/2 6+1/2 7+1/2 8+1/2 9+1/2 } }
-[ 10 [1,b] 2 moving-average ] unit-test
+[ 10 [1..b] 2 moving-average ] unit-test
 
 { { 1 1+1/2 2+1/4 3+1/8 4+1/16 5+1/32 } }
-[ 6 [1,b] 1/2 exponential-moving-average ] unit-test
+[ 6 [1..b] 1/2 exponential-moving-average ] unit-test
 { { 1 3 3 5 5 7 7 9 9 11 } }
-[ 10 [1,b] 2 exponential-moving-average ] unit-test
+[ 10 [1..b] 2 exponential-moving-average ] unit-test
 
 { { 2 5 5 4 3 } } [ { 1 2 5 6 1 4 3 } 3 moving-median ] unit-test
 
@@ -139,7 +139,7 @@ tools.test ;
         0 -1 0 -1 0 1 1 -1 0 0 1 0 0 -1 -1
     }
 } [
-    30 [1,b] [ mobius ] map
+    30 [1..b] [ mobius ] map
 ] unit-test
 
 { 1/5 } [ 3/5 1 kelly ] unit-test
index a7c01c0eb3f8d7aabbb783e2f418d142c1a31ef7..4e1bb81c19485df4619883d83c9ecc32e6d9cbd2 100644 (file)
@@ -39,7 +39,7 @@ IN: picomath
     supremum 1e-3 <
 ] unit-test
 
-: factorial ( n -- n! ) [ 1 ] [ [1,b] 1 [ * ] reduce ] if-zero ;
+: factorial ( n -- n! ) [ 1 ] [ [1..b] 1 [ * ] reduce ] if-zero ;
 
 { t } [
     { 0 1 10 100 1000 10000 } [
index 13844e9f9b801082ed8f75affbd6c9d5ab5dc2e0..4c677954df854f20c3ca3758766164d728de9672 100644 (file)
@@ -75,7 +75,7 @@ HELP: count*
     { "quot" { $quotation ( ... elt -- ... ? ) } }
     { "%" rational } }
 { $description "Outputs the fraction of elements in the sequence for which the predicate quotation matches." }
-{ $examples { $example "USING: math ranges prettyprint sequences.extras ;" "100 [1,b] [ even? ] count* ." "1/2" } } ;
+{ $examples { $example "USING: math ranges prettyprint sequences.extras ;" "100 [1..b] [ even? ] count* ." "1/2" } } ;
 
 HELP: collapse
 { $values
index 3520e4a31dc6fefe430db00b558110b2716dc6c6..0778fc10a7268735912158ebb0219f6fc6854b9e 100644 (file)
@@ -211,7 +211,7 @@ BT
 (        dup length 5 swap 2 range boa zip)'
 (        [ pdf-page , pdf-text , ] assoc-each)'
 (    ] { } make)'
-(    dup length [1,b] zip [ first2 pdf-object ] map ;)'
+(    dup length [1..b] zip [ first2 pdf-object ] map ;)'
 ( )'
 (: objects>pdf \( objects -- str \))'
 (    [ "\\n" join "\\n" append "%PDF-1.4\\n" ])'
index 3d78df1a66ba550e81bf024dd41e761f0a68f95d..0c512baf978d11314f80609a4447e770d11918e9 100644 (file)
@@ -90,7 +90,7 @@ USING: combinators io kernel locals
 math.functions math.parser ranges
 sequences ;
 
-100 [1,b] [| i |
+100 [1..b] [| i |
     {
         { [ i 15 divisor? ] [ "FizzBuzz" ] }
         { [ i  3 divisor? ] [ "Fizz" ] }