clojure.lang.Var.pushThreadBindings C# (CSharp) Méthode

pushThreadBindings() private méthode

private pushThreadBindings ( Associative bindings ) : void
bindings Associative
Résultat void
        public static void pushThreadBindings(Associative bindings)
        {
            Frame f = CurrentFrame;
            Associative bmap = f.Bindings;
            for (ISeq bs = bindings.seq(); bs != null; bs = bs.next())
            {
                IMapEntry e = (IMapEntry)bs.first();
                Var v = (Var)e.key();
                if (!v._dynamic)
                    throw new InvalidOperationException(String.Format("Can't dynamically bind non-dynamic var: {0}/{1}", v.Namespace, v.Symbol));
                v.Validate(e.val());
                v._threadBound.set(true);
                bmap = bmap.assoc(v, new TBox(Thread.CurrentThread,e.val()));
            }
            CurrentFrame = new Frame(bmap, f);
        }

Usage Example

Exemple #1
0
 protected override object Read(PushbackTextReader r, char backquote)
 {
     try
     {
         Var.pushThreadBindings(RT.map(GENSYM_ENV, PersistentHashMap.EMPTY));
         //object form = read(r, true, null, true);
         object form = ReadAux(r);
         return(syntaxQuote(form));
     }
     finally
     {
         Var.popThreadBindings();
     }
 }
All Usage Examples Of clojure.lang.Var::pushThreadBindings