]> gitweb.factorcode.org Git - factor.git/commitdiff
"NS[" syntax added to closures
authorSam Anklesaria <sam@Tintin.local>
Sun, 31 May 2009 16:56:39 +0000 (11:56 -0500)
committerSam Anklesaria <sam@Tintin.local>
Sun, 31 May 2009 16:56:39 +0000 (11:56 -0500)
extra/closures/closures.factor

index 7fd08db998990cca1726dc3f2a342483e4f59ca6..eb5a293fed9026c64609c41e74227c7f6ee11e0c 100644 (file)
@@ -1,7 +1,13 @@
-USING: assocs io.pathnames fry namespaces kernel sequences parser ;
+USING: assocs io.pathnames fry namespaces namespaces.private kernel sequences parser ;
 IN: closures
 SYMBOL: |
+
+! Selective Binding
 : delayed-bind-with ( vars quot -- quot' ) '[ _ dup [ get ] map zip [ _ bind ] curry ] ;
 SYNTAX: C[ | parse-until parse-quotation delayed-bind-with over push-all ;
 ! Common ones
-SYNTAX: DIR[ parse-quotation { current-directory } swap delayed-bind-with over push-all ;
\ No newline at end of file
+SYNTAX: DIR[ parse-quotation { current-directory } swap delayed-bind-with over push-all ;
+
+! Namespace Binding
+: bind-to-namespace ( quot -- quot' ) '[ namespace [ _ bind ] curry ] ;
+SYNTAX: NS[ parse-quotation bind-to-namespace over push-all ;
\ No newline at end of file