! Copyright (C) 2013 Dondy. ! See http://factorcode.org/license.txt for BSD license. USING: kernel math math.functions locals vectors sequences prettyprint ; IN: foobar :: zig ( p1 p2 -- p3 ) p1 first :> x1 p1 last :> y1 p2 first :> x2 p2 last :> y2 V{ } clone x1 x2 + y1 y2 - + 2 / suffix x2 x1 - y1 y2 + + 2 / suffix ; :: zag ( p1 p2 -- p3 ) p1 first :> x1 p1 last :> y1 p2 first :> x2 p2 last :> y2 V{ } clone x1 x2 + y1 y2 + - 2 / suffix x1 x2 - y1 y2 + + 2 / suffix ; :: dragon ( p1 p2 p3 n -- seq ) n 0 = [ V{ p1 p2 } push-all ] [ V{ } clone p1 p1 p2 zig p2 n 1 - dragon suffix p2 p2 p3 zag p3 n 1 - dragon suffix push-all ] if ; : foobar ( -- ) [let V{ 100 100 } :> p1 V{ 356 100 } :> p2 p1 p1 p2 zig p2 15 dragon ] . ; MAIN: foobar ! The word dragon cannot be executed because it failed to compile ! ! Stack effect declaration is wrong ! inferred ( x x x x x -- x ) ! declared ( p1 p2 p3 n -- seq ) ! Type :help for debugging help. ! :errors - show 1 compiler errors