diff --git a/extra/editors/vim/vim.factor b/extra/editors/vim/vim.factor index 8d60942d67..9ce256868b 100755 --- a/extra/editors/vim/vim.factor +++ b/extra/editors/vim/vim.factor @@ -1,5 +1,5 @@ USING: definitions io io.launcher kernel math math.parser -namespaces parser prettyprint sequences editors ; +namespaces parser prettyprint sequences editors accessors ; IN: editors.vim SYMBOL: vim-path @@ -17,8 +17,9 @@ M: vim vim-command ( file line -- array ) : vim-location ( file line -- ) vim-command - vim-detach get-global - [ run-detached ] [ run-process ] if drop ; + <process> swap >>command + vim-detach get-global [ t >>detached ] when + try-process ; "vim" vim-path set-global [ vim-location ] edit-hook set-global diff --git a/extra/io/launcher/launcher-docs.factor b/extra/io/launcher/launcher-docs.factor index 4446b82f20..dadb627fc0 100755 --- a/extra/io/launcher/launcher-docs.factor +++ b/extra/io/launcher/launcher-docs.factor @@ -113,6 +113,8 @@ HELP: try-process { $values { "desc" "a launch descriptor" } } { $description "Launches a process and waits for it to complete. If it exits with a non-zero status code, throws a " { $link process-failed } " error." } ; +{ run-process try-process run-detached } related-words + HELP: kill-process { $values { "process" process } } { $description "Kills a running process. Does nothing if the process has already exited." } ; @@ -171,6 +173,7 @@ ARTICLE: "io.launcher.launch" "Launching processes" "Launching processes:" { $subsection run-process } { $subsection try-process } +{ $subsection run-detached } "Redirecting standard input and output to a pipe:" { $subsection <process-stream> } { $subsection with-process-stream } ; diff --git a/extra/io/launcher/launcher.factor b/extra/io/launcher/launcher.factor index 9b480d0cc2..6ee8660528 100755 --- a/extra/io/launcher/launcher.factor +++ b/extra/io/launcher/launcher.factor @@ -127,10 +127,7 @@ HOOK: run-process* io-backend ( process -- handle ) run-detached dup detached>> [ dup wait-for-process drop ] unless ; -TUPLE: process-failed code ; - -: process-failed ( code -- * ) - \ process-failed boa throw ; +ERROR: process-failed code ; : try-process ( desc -- ) run-process wait-for-process dup zero? diff --git a/extra/random/blum-blum-shub/blum-blum-shub-tests.factor b/extra/random/blum-blum-shub/blum-blum-shub-tests.factor index a92f256eeb..c882dd2b4d 100644 --- a/extra/random/blum-blum-shub/blum-blum-shub-tests.factor +++ b/extra/random/blum-blum-shub/blum-blum-shub-tests.factor @@ -1,27 +1,29 @@ USING: kernel math tools.test namespaces random -random.blum-blum-shub ; +random.blum-blum-shub alien.c-types sequences splitting ; IN: blum-blum-shub.tests [ 887708070 ] [ - T{ blum-blum-shub f 590695557939 811977232793 } random-32* + T{ blum-blum-shub f 590695557939 811977232793 } clone random-32* ] unit-test [ 887708070 ] [ - T{ blum-blum-shub f 590695557939 811977232793 } [ + T{ blum-blum-shub f 590695557939 811977232793 } clone [ 32 random-bits + little-endian? [ <uint> reverse *uint ] unless ] with-random ] unit-test [ 5726770047455156646 ] [ - T{ blum-blum-shub f 590695557939 811977232793 } [ + T{ blum-blum-shub f 590695557939 811977232793 } clone [ 64 random-bits + little-endian? [ <ulonglong> 4 group [ reverse ] map concat *ulonglong ] unless ] with-random ] unit-test [ 3716213681 ] [ - 100 T{ blum-blum-shub f 200352954495 846054538649 } tuck [ + 100 T{ blum-blum-shub f 200352954495 846054538649 } clone tuck [ random-32* drop ] curry times random-32*