public override Value Next() { using var outerPopper = new ObjectRegionPopper(objectRegion, "object-region"); outerPopper.Push(); using var innerPopper = new SharedRegionPopper(region, sharedRegion, "lambda-generator"); innerPopper.Push(); var next = block.Next(); more = !next.IsNil; return(next); }
public Value Next(int index) { using var popper = new SharedRegionPopper(region, this, "loop-range-next"); popper.Push(); if (index == 0) { region.SetParameter(variable, init.Evaluate()); } if (conditionFunc()) { var result = _yielding.Map(y => y.Evaluate()).DefaultTo(() => region[variable]); region[variable] = increment.Evaluate(); return(result); } return(NilValue); }