From 5bb148fd10f628c91cf7a42304402404fe1269fa Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Thu, 25 Sep 2008 13:15:39 -0700 Subject: [PATCH] Removing distribute word from math-finance. --- extra/math/finance/finance-docs.factor | 28 ------------------------- extra/math/finance/finance-tests.factor | 6 ------ extra/math/finance/finance.factor | 6 ------ 3 files changed, 40 deletions(-) diff --git a/extra/math/finance/finance-docs.factor b/extra/math/finance/finance-docs.factor index 10deec8a69..9094a5bff6 100644 --- a/extra/math/finance/finance-docs.factor +++ b/extra/math/finance/finance-docs.factor @@ -9,34 +9,6 @@ HELP: enumerate { $values { "seq" "a sequence" } { "newseq" "a sequence" } } { $description "Returns a new sequence where each element is an array of { value, index }" } ; -HELP: distribute -{ $values { "amount" "a number of amount" } { "n" "a number of buckets" } { "seq" "a sequence" } } -{ $description - "Distribute 'amount' in 'n' buckets, as equally as possible. Returns a list of 'n' elements that sum to 'amount'.\n" -} -{ $examples - { $example - "USING: math.finance" - "3 1 distribute" - "{ 3 }" } - { $example - "USING: math.finance" - "3 3 distribute" - "{ 1 1 1 }" } - { $example - "USING: math.finance" - "5 3 distribute" - "{ 2 1 2 }" } - { $example - "USING: math.finance" - "3 5 distribute" - "{ 1 0 1 0 1 }" } - { $example - "USING: math.finance" - "1000 7 distribute" - "{ 143 143 143 142 143 143 143 }" } -} ; - HELP: sma { $values { "seq" "a sequence" } { "n" "number of periods" } { "newseq" "a sequence" } } { $description "Returns the Simple Moving Average with the specified periodicity." } ; diff --git a/extra/math/finance/finance-tests.factor b/extra/math/finance/finance-tests.factor index 8c98583c84..dce701bb2f 100644 --- a/extra/math/finance/finance-tests.factor +++ b/extra/math/finance/finance-tests.factor @@ -6,9 +6,3 @@ IN: math.finance.tests [ { 1 3 1 } ] [ { 1 3 2 6 3 } 2 momentum ] unit-test -[ { 3 } ] [ 3 1 distribute ] unit-test -[ { 1 1 1 } ] [ 3 3 distribute ] unit-test -[ { 2 1 2 } ] [ 5 3 distribute ] unit-test -[ { 1 0 1 0 1 } ] [ 3 5 distribute ] unit-test -[ { 143 143 143 142 143 143 143 } ] [ 1000 7 distribute ] unit-test - diff --git a/extra/math/finance/finance.factor b/extra/math/finance/finance.factor index ce59836442..8d33c1eb7d 100644 --- a/extra/math/finance/finance.factor +++ b/extra/math/finance/finance.factor @@ -9,12 +9,6 @@ IN: math.finance : enumerate ( seq -- newseq ) >alist ; -: distribute ( amount n -- seq ) - [ / ] keep 0 [ 0 0 ] dip - [ + [ [ dup ] dip + ] dip - [ dup round ] dip 2dup - - [ drop ] dip ] map 3nip ; -