From 305b8e61389abf70d898539202b0a7bca2a96a51 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 17 Apr 2008 19:54:52 -0500 Subject: [PATCH 1/3] Fix blum blum shub unit tests on big endian --- .../blum-blum-shub/blum-blum-shub-tests.factor | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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? [ 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? [ 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* From 1b836450979c8422d682e609f3541930402dc36a Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Fri, 18 Apr 2008 13:42:56 -0500 Subject: [PATCH 2/3] error check run process related words in docs use ERROR: --- extra/editors/vim/vim.factor | 2 +- extra/io/launcher/launcher-docs.factor | 3 +++ extra/io/launcher/launcher.factor | 5 +---- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extra/editors/vim/vim.factor b/extra/editors/vim/vim.factor index 8d60942d67..f632a478be 100755 --- a/extra/editors/vim/vim.factor +++ b/extra/editors/vim/vim.factor @@ -18,7 +18,7 @@ M: vim vim-command ( file line -- array ) : vim-location ( file line -- ) vim-command vim-detach get-global - [ run-detached ] [ run-process ] if drop ; + [ try-detached ] [ try-process ] if ; "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 } { $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? From 8635a0ee2fe52ea0c1455d844a2d79a9611e2d1d Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Fri, 18 Apr 2008 14:02:11 -0500 Subject: [PATCH 3/3] vim should work again --- extra/editors/vim/vim.factor | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/extra/editors/vim/vim.factor b/extra/editors/vim/vim.factor index f632a478be..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 - [ try-detached ] [ try-process ] if ; + swap >>command + vim-detach get-global [ t >>detached ] when + try-process ; "vim" vim-path set-global [ vim-location ] edit-hook set-global