io.backend.windows.privileges: clean up code and fix inference problem
parent
3f871d3bae
commit
9d2fb3378b
|
@ -0,0 +1,4 @@
|
||||||
|
IN: io.backend.windows.privileges.tests
|
||||||
|
USING: io.backend.windows.privileges tools.test ;
|
||||||
|
|
||||||
|
[ [ ] with-privileges ] must-infer
|
|
@ -1,12 +1,13 @@
|
||||||
USING: io.backend kernel continuations sequences
|
USING: io.backend kernel continuations sequences
|
||||||
system vocabs.loader combinators ;
|
system vocabs.loader combinators fry ;
|
||||||
IN: io.backend.windows.privileges
|
IN: io.backend.windows.privileges
|
||||||
|
|
||||||
HOOK: set-privilege io-backend ( name ? -- ) inline
|
HOOK: set-privilege io-backend ( name ? -- )
|
||||||
|
|
||||||
: with-privileges ( seq quot -- )
|
: with-privileges ( seq quot -- )
|
||||||
over [ [ t set-privilege ] each ] curry compose
|
[ '[ _ [ t set-privilege ] each @ ] ]
|
||||||
swap [ [ f set-privilege ] each ] curry [ ] cleanup ; inline
|
[ drop '[ _ [ f set-privilege ] each ] ]
|
||||||
|
2bi [ ] cleanup ; inline
|
||||||
|
|
||||||
{
|
{
|
||||||
{ [ os winnt? ] [ "io.backend.windows.nt.privileges" require ] }
|
{ [ os winnt? ] [ "io.backend.windows.nt.privileges" require ] }
|
||||||
|
|
Loading…
Reference in New Issue