1 ! Copyright (C) 2008 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: assocs combinators kernel sequences splitting system
7 HOOK: os-env os ( key -- value )
9 HOOK: set-os-env os ( value key -- )
11 HOOK: unset-os-env os ( key -- )
13 HOOK: (os-envs) os ( -- seq )
15 HOOK: (set-os-envs) os ( seq -- )
17 : os-envs ( -- assoc )
18 (os-envs) [ "=" split1 ] H{ } map>assoc ;
20 : set-os-envs ( assoc -- )
21 [ "=" glue ] { } assoc>map (set-os-envs) ;
24 { [ os unix? ] [ "environment.unix" require ] }
25 { [ os winnt? ] [ "environment.winnt" require ] }
32 os windows? ";" ":" ? split
33 [ add-vocab-root ] each
35 ] "environment" add-init-hook