diff --git a/basis/bootstrap/stage2.factor b/basis/bootstrap/stage2.factor index e7a79808ba..4da83de1b3 100644 --- a/basis/bootstrap/stage2.factor +++ b/basis/bootstrap/stage2.factor @@ -21,7 +21,7 @@ SYMBOL: bootstrap-time ] when ; : default-image-name ( -- string ) - vm file-name os windows? [ "." split1-last drop ] when + vm-path file-name os windows? [ "." split1-last drop ] when ".image" append resource-path ; : load-components ( -- ) @@ -45,7 +45,7 @@ SYMBOL: bootstrap-time "Bootstrapping is complete." print "Now, you can run Factor:" print - vm write " -i=" write "output-image" get print flush ; + vm-path write " -i=" write "output-image" get print flush ; : save/restore-error ( quot -- ) error get-global diff --git a/basis/command-line/startup/startup.factor b/basis/command-line/startup/startup.factor index 6c60e05911..8f4f21a7ae 100644 --- a/basis/command-line/startup/startup.factor +++ b/basis/command-line/startup/startup.factor @@ -6,11 +6,11 @@ IN: command-line.startup : cli-usage ( -- ) """ -Usage: """ write vm file-name write """ [Factor arguments] [script] [script arguments] +Usage: """ write vm-path file-name write """ [Factor arguments] [script] [script arguments] Common arguments: -help print this message and exit - -i= load Factor image file (default """ write vm file-stem write """.image) + -i= load Factor image file (default """ write vm-path file-stem write """.image) -run= run the MAIN: entry point of -run=listener run terminal listener -run=ui.tools run Factor development UI diff --git a/basis/compiler/tests/callback-error.factor b/basis/compiler/tests/callback-error.factor index 30d05327c3..00c932dae5 100644 --- a/basis/compiler/tests/callback-error.factor +++ b/basis/compiler/tests/callback-error.factor @@ -7,7 +7,7 @@ IN: compiler.tests.callback-error : run-vm-with-script ( -- lines ) - [ vm , callback-error-script , ] { } make >>command + [ vm-path , callback-error-script , ] { } make >>command +closed+ >>stdin +stdout+ >>stderr ascii stream-lines ; diff --git a/basis/io/backend/unix/unix-tests.factor b/basis/io/backend/unix/unix-tests.factor index 0e9493ce5d..6fb5ece7eb 100644 --- a/basis/io/backend/unix/unix-tests.factor +++ b/basis/io/backend/unix/unix-tests.factor @@ -140,7 +140,7 @@ datagram-client delete-file ! closing stdin caused some problems { } [ [ - vm , + vm-path , "-i=" image append , "-run=none" , "-e=USING: destructors namespaces io calendar threads ; input-stream get dispose 1 seconds sleep" , diff --git a/basis/io/files/info/windows/windows-tests.factor b/basis/io/files/info/windows/windows-tests.factor index 8728c2c31c..6e6a57ea94 100644 --- a/basis/io/files/info/windows/windows-tests.factor +++ b/basis/io/files/info/windows/windows-tests.factor @@ -3,4 +3,4 @@ USING: tools.test io.files.info.windows system kernel ; IN: io.files.info.windows.tests -[ ] [ vm file-times 3drop ] unit-test +[ ] [ vm-path file-times 3drop ] unit-test diff --git a/basis/io/launcher/windows/windows-tests.factor b/basis/io/launcher/windows/windows-tests.factor index ae76915c1a..210b9752b4 100644 --- a/basis/io/launcher/windows/windows-tests.factor +++ b/basis/io/launcher/windows/windows-tests.factor @@ -74,14 +74,14 @@ IN: io.launcher.windows.tests try-output-process ] must-fail -: console-vm ( -- path ) - vm ".exe" ?tail [ ".com" append ] when ; +: console-vm-path ( -- path ) + vm-path ".exe" ?tail [ ".com" append ] when ; SYMBOLS: out-path err-path ; [ ] [ - console-vm "-run=hello-world" 2array >>command + console-vm-path "-run=hello-world" 2array >>command "out.txt" unique-file [ out-path set-global ] keep >>stdout try-process ] unit-test @@ -92,7 +92,7 @@ SYMBOLS: out-path err-path ; [ "IN: scratchpad " ] [ - console-vm "-run=listener" 2array >>command + console-vm-path "-run=listener" 2array >>command +closed+ >>stdin +stdout+ >>stderr utf8 [ lines last ] with-process-reader @@ -104,7 +104,7 @@ SYMBOLS: out-path err-path ; [ ] [ launcher-test-path [ - console-vm "-script" "stderr.factor" 3array >>command + console-vm-path "-script" "stderr.factor" 3array >>command "out.txt" unique-file [ out-path set-global ] keep >>stdout "err.txt" unique-file [ err-path set-global ] keep >>stderr try-process @@ -122,7 +122,7 @@ SYMBOLS: out-path err-path ; [ ] [ launcher-test-path [ - console-vm "-script" "stderr.factor" 3array >>command + console-vm-path "-script" "stderr.factor" 3array >>command "out.txt" unique-file [ out-path set-global ] keep >>stdout +stdout+ >>stderr try-process @@ -136,7 +136,7 @@ SYMBOLS: out-path err-path ; [ "output" ] [ launcher-test-path [ - console-vm "-script" "stderr.factor" 3array >>command + console-vm-path "-script" "stderr.factor" 3array >>command "err2.txt" unique-file [ err-path set-global ] keep >>stderr utf8 stream-lines first ] with-directory @@ -151,7 +151,7 @@ SYMBOLS: out-path err-path ; [ t ] [ launcher-test-path [ - console-vm "-script" "env.factor" 3array >>command + console-vm-path "-script" "env.factor" 3array >>command utf8 [ contents ] with-process-reader ] with-directory eval( -- alist ) @@ -161,7 +161,7 @@ SYMBOLS: out-path err-path ; [ t ] [ launcher-test-path [ - console-vm "-script" "env.factor" 3array >>command + console-vm-path "-script" "env.factor" 3array >>command +replace-environment+ >>environment-mode os-envs >>environment utf8 [ contents ] with-process-reader @@ -173,7 +173,7 @@ SYMBOLS: out-path err-path ; [ "B" ] [ launcher-test-path [ - console-vm "-script" "env.factor" 3array >>command + console-vm-path "-script" "env.factor" 3array >>command { { "A" "B" } } >>environment utf8 [ contents ] with-process-reader ] with-directory eval( -- alist ) @@ -184,7 +184,7 @@ SYMBOLS: out-path err-path ; [ f ] [ launcher-test-path [ - console-vm "-script" "env.factor" 3array >>command + console-vm-path "-script" "env.factor" 3array >>command { { "USERPROFILE" "XXX" } } >>environment +prepend-environment+ >>environment-mode utf8 [ contents ] with-process-reader @@ -209,7 +209,7 @@ SYMBOLS: out-path err-path ; 2 [ launcher-test-path [ - console-vm "-script" "append.factor" 3array >>command + console-vm-path "-script" "append.factor" 3array >>command out-path get-global >>stdout try-process ] with-directory @@ -219,18 +219,18 @@ SYMBOLS: out-path err-path ; ] unit-test [ "IN: scratchpad " ] [ - console-vm "-run=listener" 2array + console-vm-path "-run=listener" 2array ascii [ "USE: system 0 exit" print flush lines last ] with-process-stream ] unit-test [ ] [ - console-vm "-run=listener" 2array + console-vm-path "-run=listener" 2array ascii [ "USE: system 0 exit" print ] with-process-writer ] unit-test [ ] [ - console-vm "-run=listener" 2array >>command + console-vm-path "-run=listener" 2array >>command "vocab:io/launcher/windows/test/input.txt" >>stdin try-process ] unit-test diff --git a/basis/tools/deploy/backend/backend.factor b/basis/tools/deploy/backend/backend.factor index 196107ccb5..98391357e0 100644 --- a/basis/tools/deploy/backend/backend.factor +++ b/basis/tools/deploy/backend/backend.factor @@ -12,8 +12,8 @@ tools.deploy.libraries vocabs.metadata.resources tools.deploy.embed locals ; IN: tools.deploy.backend -: copy-vm ( executable bundle-name -- vm ) - prepend-path vm over copy-file ; +: copy-vm ( executable bundle-name -- vm-path ) + prepend-path vm-path over copy-file ; TUPLE: vocab-manifest vocabs libraries ; @@ -87,14 +87,14 @@ ERROR: can't-deploy-library-file library ; ] bi ] { } make ; -: run-factor ( vm flags -- ) +: run-factor ( vm-path flags -- ) swap prefix dup . run-with-output ; inline DEFER: ?make-staging-image : make-staging-image ( profile -- ) dup [ but-last ?make-staging-image ] unless-empty - vm swap staging-command-line run-factor ; + vm-path swap staging-command-line run-factor ; : ?make-staging-image ( profile -- ) dup staging-image-name exists? @@ -124,19 +124,19 @@ DEFER: ?make-staging-image [ "invalid vocab manifest!" throw ] if ] if-empty ; -:: make-deploy-image ( vm image vocab config -- manifest ) +:: make-deploy-image ( vm-path image vocab config -- manifest ) make-boot-image config [ bootstrap-profile :> profile vocab "vocab-manifest-" prepend temp-file :> manifest-file image vocab manifest-file profile deploy-command-line :> flags profile ?make-staging-image - vm flags run-factor + vm-path flags run-factor manifest-file parse-vocab-manifest-file ] with-variables ; -:: make-deploy-image-executable ( vm image vocab config -- manifest ) - vm image vocab config make-deploy-image - image vm embed-image ; +:: make-deploy-image-executable ( vm-path image vocab config -- manifest ) + vm-path image vocab config make-deploy-image + image vm-path embed-image ; HOOK: deploy* os ( vocab -- ) diff --git a/basis/tools/deploy/deploy.factor b/basis/tools/deploy/deploy.factor index 515d69d741..b647c5b5c7 100644 --- a/basis/tools/deploy/deploy.factor +++ b/basis/tools/deploy/deploy.factor @@ -13,7 +13,7 @@ ERROR: no-vocab-main vocab ; dup find-vocab-root [ check-vocab-main deploy* ] [ no-vocab ] if ; : deploy-image-only ( vocab image -- ) - [ vm ] 2dip + [ vm-path ] 2dip swap dup deploy-config make-deploy-image drop ; { diff --git a/basis/tools/deploy/embed/embed.factor b/basis/tools/deploy/embed/embed.factor index e6bd5d1d52..da3c1dca94 100644 --- a/basis/tools/deploy/embed/embed.factor +++ b/basis/tools/deploy/embed/embed.factor @@ -18,4 +18,4 @@ IN: tools.deploy.embed swap [ copy-file ] keep embed-image ; : make-embedded-image ( from-image to-executable -- ) - vm swap make-embedded-image* ; + vm-path swap make-embedded-image* ; diff --git a/basis/tools/deploy/macosx/macosx.factor b/basis/tools/deploy/macosx/macosx.factor index bd05c251de..44a24fb36b 100644 --- a/basis/tools/deploy/macosx/macosx.factor +++ b/basis/tools/deploy/macosx/macosx.factor @@ -12,7 +12,7 @@ IN: tools.deploy.macosx : bundle-dir ( -- dir ) running.app? - [ vm parent-directory parent-directory parent-directory ] + [ vm-path parent-directory parent-directory parent-directory ] [ "resource:Factor.app" ] if ; diff --git a/basis/tools/deploy/shaker/shaker.factor b/basis/tools/deploy/shaker/shaker.factor index 36bb513ee8..4d7f669322 100755 --- a/basis/tools/deploy/shaker/shaker.factor +++ b/basis/tools/deploy/shaker/shaker.factor @@ -398,7 +398,7 @@ IN: tools.deploy.shaker input-stream output-stream error-stream - vm + vm-path image current-directory } % diff --git a/basis/tools/deploy/test/test.factor b/basis/tools/deploy/test/test.factor index db016f15c3..54200225af 100644 --- a/basis/tools/deploy/test/test.factor +++ b/basis/tools/deploy/test/test.factor @@ -10,7 +10,7 @@ IN: tools.deploy.test : shake-and-bake ( vocab -- ) [ test-image temp-file delete-file ] ignore-errors [ - [ vm test-image temp-file ] dip + [ vm-path test-image temp-file ] dip dup deploy-config make-deploy-image drop ] with-resource-directory ; @@ -27,7 +27,7 @@ ERROR: image-too-big actual-size max-size ; : deploy-test-command ( -- args ) os macosx? - "resource:Factor.app/Contents/MacOS/factor" normalize-path vm ? + "resource:Factor.app/Contents/MacOS/factor" normalize-path vm-path ? "-i=" test-image temp-file append 2array ; : run-temp-image ( -- ) diff --git a/basis/tools/deploy/windows/windows.factor b/basis/tools/deploy/windows/windows.factor index edab4441c1..ca3b2203f0 100755 --- a/basis/tools/deploy/windows/windows.factor +++ b/basis/tools/deploy/windows/windows.factor @@ -9,19 +9,19 @@ IN: tools.deploy.windows CONSTANT: app-icon-resource-id "APPICON" -:: copy-vm ( executable bundle-name extension -- vm ) - vm "." split1-last drop extension append +:: copy-vm ( executable bundle-name extension -- vm-path ) + vm-path "." split1-last drop extension append bundle-name executable ".exe" append append-path [ copy-file ] keep ; -: create-exe-dir ( vocab bundle-name -- vm ) +: create-exe-dir ( vocab bundle-name -- vm-path ) deploy-console? get ".com" ".exe" ? copy-vm ; : open-in-explorer ( dir -- ) [ f "open" ] dip absolute-path normalize-separators f f SW_SHOWNORMAL ShellExecute drop ; -: embed-ico ( vm vocab -- ) +: embed-ico ( vm-path vocab -- ) dup vocab-windows-icon-path vocab-append-path dup exists? [ binary file-contents app-icon-resource-id embed-icon-resource ] [ 2drop ] if ; diff --git a/core/io/files/files.factor b/core/io/files/files.factor index 96f9b92ead..c4c7fd66d7 100644 --- a/core/io/files/files.factor +++ b/core/io/files/files.factor @@ -84,6 +84,6 @@ PRIVATE> [ cwd current-directory set-global OBJ-IMAGE special-object alien>native-string cwd prepend-path \ image set-global - OBJ-EXECUTABLE special-object alien>native-string cwd prepend-path \ vm set-global + OBJ-EXECUTABLE special-object alien>native-string cwd prepend-path \ vm-path set-global init-resource-path ] "io.files" add-startup-hook diff --git a/core/system/system-docs.factor b/core/system/system-docs.factor index 134d9d9059..cddccb155e 100644 --- a/core/system/system-docs.factor +++ b/core/system/system-docs.factor @@ -10,7 +10,7 @@ ARTICLE: "system" "System interface" } "Getting the path to the Factor VM and image:" { $subsections - vm + vm-path image } "Getting a monotonically increasing nanosecond count:" @@ -76,6 +76,6 @@ HELP: image { $values { "path" "a pathname string" } } { $description "Outputs the pathname of the currently running Factor image." } ; -HELP: vm +HELP: vm-path { $values { "path" "a pathname string" } } { $description "Outputs the pathname of the currently running Factor VM." } ; diff --git a/core/system/system.factor b/core/system/system.factor index 3b26353332..0782a0c019 100644 --- a/core/system/system.factor +++ b/core/system/system.factor @@ -63,7 +63,7 @@ PRIVATE> : image ( -- path ) \ image get-global ; -: vm ( -- path ) \ vm get-global ; +: vm-path ( -- path ) \ vm-path get-global ; : embedded? ( -- ? ) OBJ-EMBEDDED special-object ; diff --git a/extra/native-thread-test/native-thread-test.factor b/extra/native-thread-test/native-thread-test.factor index fdb5384541..326cd8bc4a 100644 --- a/extra/native-thread-test/native-thread-test.factor +++ b/extra/native-thread-test/native-thread-test.factor @@ -8,7 +8,7 @@ IN: native-thread-test FUNCTION: void* start_standalone_factor_in_new_thread ( int argc, c-string* argv ) : start-vm-in-os-thread ( args -- threadhandle ) - vm prefix + vm-path prefix [ length ] [ native-string-encoding strings>alien ] bi start_standalone_factor_in_new_thread ;