public void EvalChart(RCRunner runner, RCClosure closure, RCByte right) { RCCube result = new RCCube(new RCArray <string> ("S")); DoChart <byte> (result, RCSymbolScalar.Empty, 0, 0, right); runner.Yield(closure, result); }
public void EvalTo(RCRunner runner, RCClosure closure, RCByte left, RCByte right) { byte[] result = new byte[right[0] - left[0] + 1]; for (byte i = 0; i < result.Length; ++i) { result[i] = (byte)(left[0] + i); } runner.Yield(closure, new RCByte(result)); }
public static RCBlock DoAt(RCClosure closure, RCBlock left, RCByte right) { RCBlock result = RCBlock.Empty; for (int i = 0; i < right.Count; ++i) { RCBlock next = left.GetName((long)right[i]); result = new RCBlock(result, next.Name, next.Evaluator, next.Value); } return(result); }
public void EvalTree(RCRunner runner, RCClosure closure, RCByte right) { RCCube result = new RCCube(new RCArray <string> ("S")); TreeNode root = new TreeNode(RCSymbolScalar.Empty, RCSymbolScalar.Empty); root.children = new RCArray <TreeNode> (); DoTree <byte> (root, right, ref root.n, ref root.g, Areax, Formatx); LayoutBottomUp(root, 0); LayoutTree(0, root); WriteTree(result, root); runner.Yield(closure, result); }
public void EvalHttpSend(RCRunner runner, RCClosure closure, RCLong left, RCByte right) { try { // Maybe we should send multiple here? DoHttpSend(runner, closure, left, right.ToArray()); } catch (Exception) { throw; } }
public void EvalSwitch(RCRunner runner, RCClosure closure, RCByte left, RCBlock right) { Picker <byte> picker = delegate(byte val, out bool eval) { RCBlock variable = right.GetName(val); long i = val < 0 ? 1 : 0; eval = !variable.Evaluator.Pass; return(i >= right.Count ? RCBlock.Empty : variable.Value); }; DoSwitch <byte> (runner, closure, left, right, picker); }
public void EvalSavebin(RCRunner runner, RCClosure closure, RCString left, RCByte right) { // BRIAN READ THIS WHEN YOU GET BACK HERE. // Should not be doing sync io like this. // The least I can do is use a thread pool thread. try { File.WriteAllBytes(left[0], right.ToArray()); } catch (UnauthorizedAccessException ex) { throw new RCException(closure, RCErrors.Access, ex.Message); } catch (FileNotFoundException ex) { throw new RCException(closure, RCErrors.File, ex.Message); } RCSystem.Log.Record(closure, "save", Interlocked.Increment(ref _handle), left[0], right); runner.Yield(closure, new RCString(left[0])); }
public void EvalExcept(RCRunner runner, RCClosure closure, RCByte left, RCByte right) { runner.Yield(closure, new RCByte(DoExcept <byte> (left, right))); }
public void EvalRange(RCRunner runner, RCClosure closure, RCLong left, RCByte right) { runner.Yield(closure, DoRange <byte> (left, right)); }
public void EvalRank(RCRunner runner, RCClosure closure, RCByte right) { runner.Yield(closure, new RCLong(RankUtils.DoRank <byte> (SortDirection.asc, right))); }
public void EvalRank(RCRunner runner, RCClosure closure, RCSymbol left, RCByte right) { runner.Yield(closure, new RCLong(RankUtils.DoRank <byte> (Sort.ToDir(left), right))); }
public void EvalFrom(RCRunner runner, RCClosure closure, RCByte left, RCString right) { runner.Yield(closure, DoAt <string> (closure, right, left)); }
public void EvalRepeat(RCRunner runner, RCClosure closure, RCLong left, RCByte right) { runner.Yield(closure, new RCByte(DoRepeat <byte> (left, right))); }
public void EvalShuffle(RCRunner runner, RCClosure closure, RCLong left, RCByte right) { runner.Yield(closure, new RCByte(DoShuffle <byte> (new Random((int)left[0]), right))); }
public void EvalWhere(RCRunner runner, RCClosure closure, RCByte left, RCBoolean right) { runner.Yield(closure, DoWhere <byte> (left, right)); }
public void EvalOperator(RCRunner runner, RCClosure closure, RCDouble left, RCByte right) { runner.Yield(closure, DoAt <double> (closure, left, right)); }
public void EvalOperator(RCRunner runner, RCClosure closure, RCBoolean left, RCByte right) { runner.Yield(closure, DoAt <bool> (closure, left, right)); }
public void EvalFrom(RCRunner runner, RCClosure closure, RCByte left, RCBlock right) { runner.Yield(closure, DoAt(closure, right, left)); }
public void EvalFrom(RCRunner runner, RCClosure closure, RCByte left, RCTime right) { runner.Yield(closure, DoAt <RCTimeScalar> (closure, right, left)); }
public void EvalSort(RCRunner runner, RCClosure closure, RCByte right) { runner.Yield(closure, new RCByte(DoSort <byte> (SortDirection.asc, right))); }
public void EvalSort(RCRunner runner, RCClosure closure, RCSymbol left, RCByte right) { runner.Yield(closure, new RCByte(DoSort <byte> (ToDir(left), right))); }
public void EvalLast(RCRunner runner, RCClosure closure, RCByte right) { runner.Yield(closure, new RCByte(right[right.Count - 1])); }
public void EvalCount(RCRunner runner, RCClosure closure, RCByte right) { runner.Yield(closure, new RCLong(right.Count)); }
public void EvalFirst(RCRunner runner, RCClosure closure, RCByte right) { runner.Yield(closure, new RCByte(right[0])); }
public void EvalOperator(RCRunner runner, RCClosure closure, RCByte left, RCByte right) { runner.Yield(closure, DoFind <byte> (left, right)); }
public void EvalFrom(RCRunner runner, RCClosure closure, RCByte left, RCDecimal right) { runner.Yield(closure, DoAt <decimal> (closure, right, left)); }
public void EvalPop(RCRunner runner, RCClosure closure, RCByte right) { runner.Yield(closure, new RCByte(DoPop <byte> (right.Data))); }
public void EvalUnique(RCRunner runner, RCClosure closure, RCByte right) { runner.Yield(closure, new RCByte(DoUnique <byte> (right))); }
public void EvalUnion(RCRunner runner, RCClosure closure, RCByte left, RCByte right) { runner.Yield(closure, new RCByte(DoUnion <byte> (left, right))); }
public void EvalDups(RCRunner runner, RCClosure closure, RCByte right) { runner.Yield(closure, new RCByte(DoDups <byte> (right))); }