1 ! Copyright (C) 2009 Nicholas Seckar.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: continuations eval fuel fuel.private namespaces tools.test words ;
6 : fake-continuation ( -- continuation )
7 f f f "fake" f <continuation> ;
9 : make-uses-restart ( -- restart )
10 "Use the words vocabulary" \ word?
11 fake-continuation <restart> ;
13 : make-defer-restart ( -- restart )
14 "Defer word in current vocabulary" f
15 fake-continuation <restart> ;
17 { f } [ make-defer-restart is-use-restart? ] unit-test
18 { t } [ make-uses-restart is-use-restart? ] unit-test
20 { "words" } [ make-uses-restart get-restart-vocab ] unit-test
22 { f } [ make-defer-restart is-suggested-restart? ] unit-test
23 { f } [ make-uses-restart is-suggested-restart? ] unit-test
24 { f } [ { "io" } :uses-suggestions
25 [ make-uses-restart is-suggested-restart? ] with-variable
27 { t } [ { "words" } :uses-suggestions
28 [ make-uses-restart is-suggested-restart? ] with-variable
32 { "kernel" } [ "\\ dup drop" eval( -- ) ] fuel-use-suggested-vocabs