]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/taxes/usa/federal/federal.factor
factor: trim using lists
[factor.git] / extra / taxes / usa / federal / federal.factor
index 4b6d516369f82fd325803d161e32d65716092a2d..908cfee63afbf9a966f4572f49a7b9c3d989fedd 100644 (file)
@@ -1,12 +1,11 @@
 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays assocs kernel math math.intervals
-namespaces sequences money math.order taxes.usa.fica
-taxes.usa.medicare taxes.usa taxes.usa.w4 ;
+USING: accessors kernel math money taxes.usa taxes.usa.fica
+taxes.usa.medicare taxes.usa.w4 ;
 IN: taxes.usa.federal
 
 ! http://www.irs.gov/pub/irs-pdf/p15.pdf
-! Table 7 ANNUAL Payroll Period 
+! Table 7 ANNUAL Payroll Period
 
 : federal-single ( -- triples )
     {
@@ -42,13 +41,13 @@ M: federal adjust-allowances* ( salary w4 collector entity -- newsalary )
 
 M: federal withholding* ( salary w4 tax-table entity -- x )
     drop
-    [ federal-tax ] 3keep drop
+    [ federal-tax ] 2keepd
     [ fica-tax ] 2keep
     medicare-tax + + ;
 
 : total-withholding ( salary w4 tax-table -- x )
     dup entity>> dup federal = [
-        withholding* 
+        withholding*
     ] [
         drop
         [ drop <federal> federal withholding* ]