diff --git a/basis/roman/roman-docs.factor b/basis/roman/roman-docs.factor index bb596c4345..9f2539292d 100644 --- a/basis/roman/roman-docs.factor +++ b/basis/roman/roman-docs.factor @@ -92,11 +92,11 @@ HELP: roman/mod { roman* roman/i roman/mod } related-words -HELP: ROMAN: +HELP: roman: { $description "A parsing word that reads the next token and converts it to an integer." } { $examples { $example "USING: prettyprint roman ;" - "ROMAN: v ." + "roman: v ." "5" } } ; @@ -104,7 +104,7 @@ HELP: ROMAN: ARTICLE: "roman" "Roman numerals" "The " { $vocab-link "roman" } " vocabulary can convert numbers to and from the Roman numeral system and can perform arithmetic given Roman numerals as input." $nl "A parsing word for literal Roman numerals:" -{ $subsections POSTPONE: ROMAN: } +{ $subsections POSTPONE: roman: } "Converting to Roman numerals:" { $subsections >roman diff --git a/basis/roman/roman-tests.factor b/basis/roman/roman-tests.factor index b43f513a94..5ceb286557 100644 --- a/basis/roman/roman-tests.factor +++ b/basis/roman/roman-tests.factor @@ -37,7 +37,7 @@ USING: arrays kernel math roman roman.private sequences tools.test ; { "i" "ii" } [ "v" "iii" roman/mod ] unit-test [ "iii" "iii" roman- ] must-fail -{ 30 } [ ROMAN: xxx ] unit-test +{ 30 } [ roman: xxx ] unit-test [ roman+ ] must-infer [ roman- ] must-infer diff --git a/basis/roman/roman.factor b/basis/roman/roman.factor index 632b5050ba..cf2bbd9a9e 100644 --- a/basis/roman/roman.factor +++ b/basis/roman/roman.factor @@ -69,4 +69,4 @@ ROMAN-OP: * ( x y -- z ) ROMAN-OP: /i ( x y -- z ) ROMAN-OP: /mod ( x y -- z w ) -SYNTAX: ROMAN: scan-token roman> suffix! ; +SYNTAX: roman: scan-token roman> suffix! ; diff --git a/extra/benchmark/e-decimals/e-decimals.factor b/extra/benchmark/e-decimals/e-decimals.factor index c1220231fd..956e30b659 100644 --- a/extra/benchmark/e-decimals/e-decimals.factor +++ b/extra/benchmark/e-decimals/e-decimals.factor @@ -5,11 +5,11 @@ sequences ; IN: benchmark.e-decimals : D-factorial ( n -- D! ) - DECIMAL: 1 [ 0 DECIMAL: 1 D+ D* ] reduce ; inline + decimal: 1 [ 0 decimal: 1 D+ D* ] reduce ; inline :: calculate-e-decimals ( n -- e ) - n [1,b] DECIMAL: 1 - [ D-factorial DECIMAL: 1 swap n D/ D+ ] reduce ; + n [1,b] decimal: 1 + [ D-factorial decimal: 1 swap n D/ D+ ] reduce ; : e-decimals-benchmark ( -- ) 5 [ 800 calculate-e-decimals drop ] times ; diff --git a/extra/decimals/decimals-tests.factor b/extra/decimals/decimals-tests.factor index 4a9baced07..5aaee8b906 100644 --- a/extra/decimals/decimals-tests.factor +++ b/extra/decimals/decimals-tests.factor @@ -5,7 +5,7 @@ locals math math.functions math.order random tools.test ; IN: decimals.tests { t } [ - DECIMAL: 12.34 DECIMAL: 00012.34000 = + decimal: 12.34 decimal: 00012.34000 = ] unit-test : random-test-int ( -- n ) @@ -37,15 +37,15 @@ ERROR: decimal-test-failure D1 D2 quot ; ] unit-test { t } [ - { DECIMAL: 0. DECIMAL: .0 DECIMAL: 0.0 DECIMAL: 00.00 DECIMAL: . } all-equal? + { decimal: 0. decimal: .0 decimal: 0.0 decimal: 00.00 decimal: . } all-equal? ] unit-test { t } [ T{ decimal f 90 0 } T{ decimal f 9 1 } = ] unit-test -{ t } [ DECIMAL: 1 DECIMAL: 2 before? ] unit-test -{ f } [ DECIMAL: 2 DECIMAL: 2 before? ] unit-test -{ f } [ DECIMAL: 3 DECIMAL: 2 before? ] unit-test -{ f } [ DECIMAL: -1 DECIMAL: -2 before? ] unit-test -{ f } [ DECIMAL: -2 DECIMAL: -2 before? ] unit-test -{ t } [ DECIMAL: -3 DECIMAL: -2 before? ] unit-test -{ t } [ DECIMAL: .5 DECIMAL: 0 DECIMAL: 1.0 between? ] unit-test +{ t } [ decimal: 1 decimal: 2 before? ] unit-test +{ f } [ decimal: 2 decimal: 2 before? ] unit-test +{ f } [ decimal: 3 decimal: 2 before? ] unit-test +{ f } [ decimal: -1 decimal: -2 before? ] unit-test +{ f } [ decimal: -2 decimal: -2 before? ] unit-test +{ t } [ decimal: -3 decimal: -2 before? ] unit-test +{ t } [ decimal: .5 decimal: 0 decimal: 1.0 between? ] unit-test diff --git a/extra/decimals/decimals.factor b/extra/decimals/decimals.factor index b8eb6a6929..db850a25aa 100644 --- a/extra/decimals/decimals.factor +++ b/extra/decimals/decimals.factor @@ -19,7 +19,7 @@ C: decimal : parse-decimal ( -- decimal ) scan-token string>decimal ; -SYNTAX: DECIMAL: parse-decimal suffix! ; +SYNTAX: decimal: parse-decimal suffix! ; : decimal>ratio ( decimal -- ratio ) >decimal< 10^ * ; diff --git a/extra/money/money-tests.factor b/extra/money/money-tests.factor index 786b4828a9..42108738fb 100644 --- a/extra/money/money-tests.factor +++ b/extra/money/money-tests.factor @@ -1,28 +1,28 @@ USING: money parser tools.test eval ; IN: money.tests -{ -1/10 } [ DECIMAL: -.1 ] unit-test -{ -1/10 } [ DECIMAL: -0.1 ] unit-test -{ -1/10 } [ DECIMAL: -00.10 ] unit-test +{ -1/10 } [ decimal: -.1 ] unit-test +{ -1/10 } [ decimal: -0.1 ] unit-test +{ -1/10 } [ decimal: -00.10 ] unit-test -{ 0 } [ DECIMAL: .0 ] unit-test -{ 0 } [ DECIMAL: 0.0 ] unit-test -{ 0 } [ DECIMAL: 0. ] unit-test -{ 0 } [ DECIMAL: 0 ] unit-test -{ 1/10 } [ DECIMAL: .1 ] unit-test -{ 1/10 } [ DECIMAL: 0.1 ] unit-test -{ 1/10 } [ DECIMAL: 00.10 ] unit-test -{ 23 } [ DECIMAL: 23 ] unit-test -{ -23 } [ DECIMAL: -23 ] unit-test -{ -23-1/100 } [ DECIMAL: -23.01 ] unit-test +{ 0 } [ decimal: .0 ] unit-test +{ 0 } [ decimal: 0.0 ] unit-test +{ 0 } [ decimal: 0. ] unit-test +{ 0 } [ decimal: 0 ] unit-test +{ 1/10 } [ decimal: .1 ] unit-test +{ 1/10 } [ decimal: 0.1 ] unit-test +{ 1/10 } [ decimal: 00.10 ] unit-test +{ 23 } [ decimal: 23 ] unit-test +{ -23 } [ decimal: -23 ] unit-test +{ -23-1/100 } [ decimal: -23.01 ] unit-test -[ "DECIMAL: ." eval ] must-fail -[ "DECIMAL: f" eval ] must-fail -[ "DECIMAL: 0.f" eval ] must-fail -[ "DECIMAL: f.0" eval ] must-fail +[ "decimal: ." eval ] must-fail +[ "decimal: f" eval ] must-fail +[ "decimal: 0.f" eval ] must-fail +[ "decimal: f.0" eval ] must-fail -{ "$100.00" } [ DECIMAL: 100.0 money>string ] unit-test -{ "$0.00" } [ DECIMAL: 0.0 money>string ] unit-test +{ "$100.00" } [ decimal: 100.0 money>string ] unit-test +{ "$0.00" } [ decimal: 0.0 money>string ] unit-test { "$1.00" } [ 1.0 money>string ] unit-test { "$1.00" } [ 1 money>string ] unit-test diff --git a/extra/money/money.factor b/extra/money/money.factor index 6b54b231a3..571bd19e44 100644 --- a/extra/money/money.factor +++ b/extra/money/money.factor @@ -31,4 +31,4 @@ ERROR: not-an-integer x ; [ dup string>number [ ] [ not-an-integer ] ?if ] bi@ ] keep length 10^ / + swap [ neg ] when ; -SYNTAX: DECIMAL: scan-token parse-decimal suffix! ; +SYNTAX: decimal: scan-token parse-decimal suffix! ; diff --git a/extra/taxes/usa/federal/federal.factor b/extra/taxes/usa/federal/federal.factor index fcddd58b6b..44ecac7ad4 100644 --- a/extra/taxes/usa/federal/federal.factor +++ b/extra/taxes/usa/federal/federal.factor @@ -10,24 +10,24 @@ IN: taxes.usa.federal : federal-single ( -- triples ) { - { 0 2650 DECIMAL: 0 } - { 2650 10300 DECIMAL: .10 } - { 10300 33960 DECIMAL: .15 } - { 33960 79725 DECIMAL: .25 } - { 79725 166500 DECIMAL: .28 } - { 166500 359650 DECIMAL: .33 } - { 359650 1/0. DECIMAL: .35 } + { 0 2650 decimal: 0 } + { 2650 10300 decimal: .10 } + { 10300 33960 decimal: .15 } + { 33960 79725 decimal: .25 } + { 79725 166500 decimal: .28 } + { 166500 359650 decimal: .33 } + { 359650 1/0. decimal: .35 } } ; : federal-married ( -- triples ) { - { 0 8000 DECIMAL: 0 } - { 8000 23550 DECIMAL: .10 } - { 23550 72150 DECIMAL: .15 } - { 72150 137850 DECIMAL: .25 } - { 137850 207700 DECIMAL: .28 } - { 207700 365100 DECIMAL: .33 } - { 365100 1/0. DECIMAL: .35 } + { 0 8000 decimal: 0 } + { 8000 23550 decimal: .10 } + { 23550 72150 decimal: .15 } + { 72150 137850 decimal: .25 } + { 137850 207700 decimal: .28 } + { 207700 365100 decimal: .33 } + { 365100 1/0. decimal: .35 } } ; SINGLETON: federal diff --git a/extra/taxes/usa/fica/fica.factor b/extra/taxes/usa/fica/fica.factor index 4541a15eca..cd261d4c03 100644 --- a/extra/taxes/usa/fica/fica.factor +++ b/extra/taxes/usa/fica/fica.factor @@ -3,7 +3,7 @@ USING: accessors math math.order money kernel assocs ; IN: taxes.usa.fica -: fica-tax-rate ( -- x ) DECIMAL: .062 ; inline +: fica-tax-rate ( -- x ) decimal: .062 ; inline ERROR: fica-base-unknown ; diff --git a/extra/taxes/usa/futa/futa.factor b/extra/taxes/usa/futa/futa.factor index 9b862a8960..3b51206b0c 100644 --- a/extra/taxes/usa/futa/futa.factor +++ b/extra/taxes/usa/futa/futa.factor @@ -5,9 +5,9 @@ namespaces sequences money math.order ; IN: taxes.usa.futa ! Employer tax only, not withheld -: futa-tax-rate ( -- x ) DECIMAL: .062 ; inline +: futa-tax-rate ( -- x ) decimal: .062 ; inline : futa-base-rate ( -- x ) 7000 ; inline -: futa-tax-offset-credit ( -- x ) DECIMAL: .054 ; inline +: futa-tax-offset-credit ( -- x ) decimal: .054 ; inline : futa-tax ( salary w4 -- x ) drop futa-base-rate min diff --git a/extra/taxes/usa/medicare/medicare.factor b/extra/taxes/usa/medicare/medicare.factor index ea95224456..24eb38774d 100644 --- a/extra/taxes/usa/medicare/medicare.factor +++ b/extra/taxes/usa/medicare/medicare.factor @@ -4,5 +4,5 @@ USING: kernel math money ; IN: taxes.usa.medicare ! No base rate for medicare; all wages subject -: medicare-tax-rate ( -- x ) DECIMAL: .0145 ; inline +: medicare-tax-rate ( -- x ) decimal: .0145 ; inline : medicare-tax ( salary w4 -- x ) drop medicare-tax-rate * ; diff --git a/extra/taxes/usa/mn/mn.factor b/extra/taxes/usa/mn/mn.factor index 8bb629efcd..ad0bf7695a 100644 --- a/extra/taxes/usa/mn/mn.factor +++ b/extra/taxes/usa/mn/mn.factor @@ -8,18 +8,18 @@ IN: taxes.usa.mn ! Minnesota : mn-single ( -- triples ) { - { 0 1950 DECIMAL: 0 } - { 1950 23750 DECIMAL: .0535 } - { 23750 73540 DECIMAL: .0705 } - { 73540 1/0. DECIMAL: .0785 } + { 0 1950 decimal: 0 } + { 1950 23750 decimal: .0535 } + { 23750 73540 decimal: .0705 } + { 73540 1/0. decimal: .0785 } } ; : mn-married ( -- triples ) { - { 0 7400 DECIMAL: 0 } - { 7400 39260 DECIMAL: .0535 } - { 39260 133980 DECIMAL: .0705 } - { 133980 1/0. DECIMAL: .0785 } + { 0 7400 decimal: 0 } + { 7400 39260 decimal: .0535 } + { 39260 133980 decimal: .0705 } + { 133980 1/0. decimal: .0785 } } ; : ( -- obj )