From 380cd2d3b061e2e378713215b894ae2156da04cd Mon Sep 17 00:00:00 2001 From: Aaron Schaefer Date: Fri, 7 Nov 2008 01:36:02 -0500 Subject: [PATCH] Clean up of math.finance --- extra/math/finance/finance.factor | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/extra/math/finance/finance.factor b/extra/math/finance/finance.factor index db300a3b70..f006e6aee7 100644 --- a/extra/math/finance/finance.factor +++ b/extra/math/finance/finance.factor @@ -1,18 +1,16 @@ -! Copyright (C) 2008 John Benediktsson -! See http://factorcode.org/license.txt for BSD license - +! Copyright (C) 2008 John Benediktsson. +! See http://factorcode.org/license.txt for BSD license. USING: arrays assocs kernel grouping sequences shuffle math math.functions math.statistics math.vectors ; - IN: math.finance @@ -26,6 +24,5 @@ PRIVATE> rot dup ema [ swap ema ] dip v- ; : momentum ( seq n -- newseq ) - 2dup tail-slice -rot swap [ length ] keep - [ - neg ] dip swap head-slice v- ; + [ tail-slice ] 2keep [ dup length ] dip - head-slice v- ;