1 ! Copyright (C) 2006 Chris Double.
2 ! See http://factorcode.org/license.txt for BSD license.
3 IN: partial-continuations
4 USING: kernel continuations arrays sequences quotations ;
7 [ 1array swap keep first continue-with ] callcc1 nip ;
9 : (bshift) ( v r k -- obj )
10 [ dup first -rot ] dip
15 [ drop nip set-first ] dip ;
17 : bshift ( r quot -- )
20 [ (bshift) ] 2curry swap call
21 ] dip first continue-with
22 ] callcc1 2nip ; inline