Merge branch 'clean-linux-x86-32' of git://factorcode.org/git/factor
commit
d2c6503fe0
|
@ -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
|
||||
|
|
|
@ -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 } ;
|
||||
|
|
|
@ -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?
|
||||
|
|
|
@ -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*
|
||||
|
|
Loading…
Reference in New Issue