diff --git a/extra/flatland/flatland.factor b/extra/flatland/flatland.factor index c98c5a6c57..72d9e50a9d 100644 --- a/extra/flatland/flatland.factor +++ b/extra/flatland/flatland.factor @@ -2,6 +2,7 @@ USING: accessors arrays fry kernel math math.vectors sequences math.intervals multi-methods + combinators.short-circuit combinators.cleave.enhanced multi-method-syntax ; @@ -218,3 +219,16 @@ USING: locals combinators ; cond 2array ; + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +GENERIC: within? ( a b -- ? ) + +METHOD: within? ( -- ? ) + { + [ left to-the-right-of? ] + [ right to-the-left-of? ] + [ bottom above? ] + [ top below? ] + } + 2&& ;