1 ! Copyright (C) 2008 John Benediktsson.
2 ! See http://factorcode.org/license.txt for BSD license
3 USING: math math.order kernel ;
7 [ [ abs ] bi@ < ] most ;
10 [ [ abs ] bi@ > ] most ;
18 : max-by ( obj1 obj2 quot: ( obj -- n ) -- obj1/obj2 )
19 [ bi@ dupd max = ] curry most ; inline
21 : min-by ( obj1 obj2 quot: ( obj -- n ) -- obj1/obj2 )
22 [ bi@ dupd min = ] curry most ; inline