env vocab for accessing the environment as an assoc
parent
77c56e55a3
commit
d039c803eb
|
@ -0,0 +1 @@
|
|||
Joe Groff
|
|
@ -0,0 +1,13 @@
|
|||
! (c)2009 Joe Groff, see bsd license
|
||||
USING: help.markup help.syntax ;
|
||||
IN: env
|
||||
|
||||
HELP: env
|
||||
{ $class-description "A singleton that implements the " { $link "assocs-protocol" } " over " { $link "environment" } "." } ;
|
||||
|
||||
ARTICLE: "env" "Accessing the environment via the assoc protocol"
|
||||
"The " { $vocab-link "env" } " vocabulary defines a " { $link env } " word which implements the " { $link "assocs-protocol" } " over " { $link "environment" } "."
|
||||
{ $subsection env }
|
||||
;
|
||||
|
||||
ABOUT: "env"
|
|
@ -0,0 +1,26 @@
|
|||
! (c)2009 Joe Groff, see bsd license
|
||||
USING: assocs environment kernel sequences ;
|
||||
IN: env
|
||||
|
||||
SINGLETON: env
|
||||
|
||||
INSTANCE: env assoc
|
||||
|
||||
M: env at*
|
||||
drop os-env dup >boolean ;
|
||||
|
||||
M: env assoc-size
|
||||
drop (os-envs) length ;
|
||||
|
||||
M: env >alist
|
||||
drop os-envs >alist ;
|
||||
|
||||
M: env set-at
|
||||
drop set-os-env ;
|
||||
|
||||
M: env delete-at
|
||||
drop unset-os-env ;
|
||||
|
||||
M: env clear-assoc
|
||||
drop os-envs keys [ unset-os-env ] each ;
|
||||
|
|
@ -0,0 +1 @@
|
|||
Access environment variables via the assoc protocol
|
Loading…
Reference in New Issue