1 ! Copyright (C) 2009 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: functors kernel math.order sequences sorting ;
6 <FUNCTOR: define-sorting ( NAME QUOT -- )
8 NAME<=> DEFINES ${NAME}<=>
9 NAME>=< DEFINES ${NAME}>=<
13 : NAME<=> ( obj1 obj2 -- <=> ) QUOT compare ;
14 : NAME>=< ( obj1 obj2 -- >=< ) NAME<=> invert-comparison ;