示例#1
0
 LazyTransformer(IPersistentMap meta, object first, LazyTransformer rest)
     : base(meta)
 {
     _stepper = null;
     _first   = first;
     _rest    = rest;
 }
示例#2
0
            public override Object invoke(Object result)
            {
                LazyTransformer lt = (LazyTransformer)result;

                lt._stepper = null;
                return(lt);
            }
示例#3
0
            public override Object invoke(Object result)
            {
                LazyTransformer lt = (LazyTransformer)(RT.isReduced(result)?
                                                       ((Reduced)result).deref():result);

                lt._stepper = null;
                return(lt);
            }
示例#4
0
            public override Object invoke(Object result, Object input)
            {
                LazyTransformer lt = (LazyTransformer)result;

                lt._first   = input;
                lt._rest    = new LazyTransformer(lt._stepper);
                lt._stepper = null;
                return(lt._rest);
            }
示例#5
0
 public void step(LazyTransformer lt)
 {
     while (lt._stepper != null && MoveNext())
     {
         if (RT.isReduced(_xform.applyTo(RT.cons(lt, Current()))))
         {
             if (lt._rest != null)
             {
                 lt._rest._stepper = null;
             }
             break;
         }
     }
     if (lt._stepper != null)
     {
         _xform.invoke(lt);
     }
 }
示例#6
0
 public void step(LazyTransformer lt)
 {
     while (lt._stepper != null && MoveNext())
     {
         if (RT.isReduced(_xform.applyTo(RT.cons(lt, Current()))))
         {
             lt._stepper = null;
             LazyTransformer et = lt;
             while (et._rest != null)
             {
                 et          = et._rest;
                 et._stepper = null;
             }
             _xform.invoke(et);
             return;
         }
     }
     if (lt._stepper != null)
     {
         _xform.invoke(lt);
     }
 }