]> gitweb.factorcode.org Git - factor.git/blobdiff - core/math/order/order.factor
Resolved merge.
[factor.git] / core / math / order / order.factor
index a06209bf63cf983ea42e94de6d5b7d38a40d0e30..435eec9b96102af3922ad6b492ada0bbe04568d6 100644 (file)
@@ -34,6 +34,7 @@ M: real after=? ( obj1 obj2 -- ? ) >= ;
 
 : min ( x y -- z ) [ before? ] most ; inline 
 : max ( x y -- z ) [ after? ] most ; inline
+: clamp ( x min max -- y ) [ max ] dip min ; inline
 
 : between? ( x y z -- ? )
     pick after=? [ after=? ] [ 2drop f ] if ; inline