2009-06-10 17:15:02 -04:00
|
|
|
USING: assocs io.pathnames fry namespaces namespaces.private kernel sequences parser hashtables ;
|
2009-05-05 18:24:59 -04:00
|
|
|
IN: closures
|
2009-05-27 20:37:24 -04:00
|
|
|
SYMBOL: |
|
2009-05-31 12:56:39 -04:00
|
|
|
|
|
|
|
! Selective Binding
|
2009-06-10 17:15:02 -04:00
|
|
|
: delayed-bind-with ( vars quot -- quot' ) '[ _ dup [ get ] map zip >hashtable [ _ bind ] curry ] ;
|
2009-05-27 20:37:24 -04:00
|
|
|
SYNTAX: C[ | parse-until parse-quotation delayed-bind-with over push-all ;
|
|
|
|
! Common ones
|
2009-05-31 12:56:39 -04:00
|
|
|
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 ;
|