]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/environment/environment.factor
stomp.cli: simplify
[factor.git] / basis / environment / environment.factor
index 79c83733a3bfd59713952748ef1c772eb514864e..ffd3eb441d4477f1544c4f11b5e865ab1097d4db 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2008 Doug Coleman.
-! See http://factorcode.org/license.txt for BSD license.
-USING: assocs combinators continuations init kernel sequences
+! See https://factorcode.org/license.txt for BSD license.
+USING: assocs combinators continuations kernel sequences
 splitting system vocabs vocabs.loader ;
 IN: environment
 
@@ -27,17 +27,16 @@ HOOK: set-os-envs-pointer os ( malloc -- )
 
 : with-os-env ( value key quot -- )
     over [ [ [ set-os-env ] 2curry ] [ compose ] bi* ] dip
-    [ os-env ] keep [ set-os-env ] 2curry [ ] cleanup ; inline
+    [ os-env ] keep [ set-os-env ] 2curry finally ; inline
 
 {
     { [ os unix? ] [ "environment.unix" require ] }
     { [ os windows? ] [ "environment.windows" require ] }
 } cond
 
-[
-    "FACTOR_ROOTS" os-env
-    [
+STARTUP-HOOK: [
+    "FACTOR_ROOTS" os-env [
         os windows? ";" ":" ? split
         [ add-vocab-root ] each
     ] when*
-] "environment" add-startup-hook
+]