]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/math/function-tools/function-tools.factor
factor: trim using lists
[factor.git] / extra / math / function-tools / function-tools.factor
index 802bf9e14ee8a0ad17b6a97101fc54a64fe35c15..5481ef8809b1c90ab9f7a07c91858f6d4bea3509 100644 (file)
@@ -1,9 +1,18 @@
-! Copyright © 2008 Reginald Keith Ford II
-! Tools for quickly comparing, transforming, and evaluating mathematical Factor functions
-
-USING: kernel math arrays sequences sequences.lib ;
-IN: math.function-tools 
-: difference-func ( func func -- func ) [ bi - ] 2curry ;
-: eval ( x func -- pt ) dupd call 2array ;
-: eval-inverse ( y func -- pt ) dupd call swap 2array ;
-: eval3d ( x y func -- pt ) [ 2dup ] dip call 3array ;
+! Copyright (c) 2008 Reginald Keith Ford II.
+! See http://factorcode.org/license.txt for BSD license.
+USING: kernel math arrays ;
+IN: math.function-tools
+
+! Tools for quickly comparing, transforming, and evaluating mathematical functions
+
+: difference-func ( func func -- func )
+    [ bi - ] 2curry ; inline
+
+: eval ( x func -- pt )
+    dupd call( x -- y ) 2array ; inline
+
+: eval-inverse ( y func -- pt )
+    dupd call( y -- x ) swap 2array ; inline
+
+: eval3d ( x y func -- pt )
+    [ 2dup ] dip call( x y -- z ) 3array ; inline