Exemple #1
0
        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);
        }
Exemple #2
0
 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));
 }
Exemple #3
0
        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);
        }
Exemple #4
0
        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);
        }
Exemple #5
0
 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;
     }
 }
Exemple #6
0
        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);
        }
Exemple #7
0
 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]));
 }
Exemple #8
0
 public void EvalExcept(RCRunner runner, RCClosure closure, RCByte left, RCByte right)
 {
     runner.Yield(closure, new RCByte(DoExcept <byte> (left, right)));
 }
Exemple #9
0
 public void EvalRange(RCRunner runner, RCClosure closure, RCLong left, RCByte right)
 {
     runner.Yield(closure, DoRange <byte> (left, right));
 }
Exemple #10
0
 public void EvalRank(RCRunner runner, RCClosure closure, RCByte right)
 {
     runner.Yield(closure, new RCLong(RankUtils.DoRank <byte> (SortDirection.asc, right)));
 }
Exemple #11
0
 public void EvalRank(RCRunner runner, RCClosure closure, RCSymbol left, RCByte right)
 {
     runner.Yield(closure, new RCLong(RankUtils.DoRank <byte> (Sort.ToDir(left), right)));
 }
Exemple #12
0
 public void EvalFrom(RCRunner runner, RCClosure closure, RCByte left, RCString right)
 {
     runner.Yield(closure, DoAt <string> (closure, right, left));
 }
Exemple #13
0
 public void EvalRepeat(RCRunner runner, RCClosure closure, RCLong left, RCByte right)
 {
     runner.Yield(closure, new RCByte(DoRepeat <byte> (left, right)));
 }
Exemple #14
0
 public void EvalShuffle(RCRunner runner, RCClosure closure, RCLong left, RCByte right)
 {
     runner.Yield(closure, new RCByte(DoShuffle <byte> (new Random((int)left[0]), right)));
 }
Exemple #15
0
 public void EvalWhere(RCRunner runner, RCClosure closure, RCByte left, RCBoolean right)
 {
     runner.Yield(closure, DoWhere <byte> (left, right));
 }
Exemple #16
0
 public void EvalOperator(RCRunner runner, RCClosure closure, RCDouble left, RCByte right)
 {
     runner.Yield(closure, DoAt <double> (closure, left, right));
 }
Exemple #17
0
 public void EvalOperator(RCRunner runner, RCClosure closure, RCBoolean left, RCByte right)
 {
     runner.Yield(closure, DoAt <bool> (closure, left, right));
 }
Exemple #18
0
 public void EvalFrom(RCRunner runner, RCClosure closure, RCByte left, RCBlock right)
 {
     runner.Yield(closure, DoAt(closure, right, left));
 }
Exemple #19
0
 public void EvalFrom(RCRunner runner, RCClosure closure, RCByte left, RCTime right)
 {
     runner.Yield(closure, DoAt <RCTimeScalar> (closure, right, left));
 }
Exemple #20
0
 public void EvalSort(RCRunner runner, RCClosure closure, RCByte right)
 {
     runner.Yield(closure, new RCByte(DoSort <byte> (SortDirection.asc, right)));
 }
Exemple #21
0
 public void EvalSort(RCRunner runner, RCClosure closure, RCSymbol left, RCByte right)
 {
     runner.Yield(closure, new RCByte(DoSort <byte> (ToDir(left), right)));
 }
Exemple #22
0
 public void EvalLast(RCRunner runner, RCClosure closure, RCByte right)
 {
     runner.Yield(closure, new RCByte(right[right.Count - 1]));
 }
Exemple #23
0
 public void EvalCount(RCRunner runner, RCClosure closure, RCByte right)
 {
     runner.Yield(closure, new RCLong(right.Count));
 }
Exemple #24
0
 public void EvalFirst(RCRunner runner, RCClosure closure, RCByte right)
 {
     runner.Yield(closure, new RCByte(right[0]));
 }
Exemple #25
0
 public void EvalOperator(RCRunner runner, RCClosure closure, RCByte left, RCByte right)
 {
     runner.Yield(closure, DoFind <byte> (left, right));
 }
Exemple #26
0
 public void EvalFrom(RCRunner runner, RCClosure closure, RCByte left, RCDecimal right)
 {
     runner.Yield(closure, DoAt <decimal> (closure, right, left));
 }
Exemple #27
0
 public void EvalPop(RCRunner runner, RCClosure closure, RCByte right)
 {
     runner.Yield(closure, new RCByte(DoPop <byte> (right.Data)));
 }
Exemple #28
0
 public void EvalUnique(RCRunner runner, RCClosure closure, RCByte right)
 {
     runner.Yield(closure, new RCByte(DoUnique <byte> (right)));
 }
Exemple #29
0
 public void EvalUnion(RCRunner runner, RCClosure closure, RCByte left, RCByte right)
 {
     runner.Yield(closure, new RCByte(DoUnion <byte> (left, right)));
 }
Exemple #30
0
 public void EvalDups(RCRunner runner, RCClosure closure, RCByte right)
 {
     runner.Yield(closure, new RCByte(DoDups <byte> (right)));
 }