env vocab for accessing the environment as an assoc

db4
Joe Groff 2009-04-23 12:08:30 -05:00
parent 77c56e55a3
commit d039c803eb
4 changed files with 41 additions and 0 deletions

1
extra/env/authors.txt vendored Normal file
View File

@ -0,0 +1 @@
Joe Groff

13
extra/env/env-docs.factor vendored Normal file
View File

@ -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"

26
extra/env/env.factor vendored Normal file
View File

@ -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 ;

1
extra/env/summary.txt vendored Normal file
View File

@ -0,0 +1 @@
Access environment variables via the assoc protocol