public static RCVector <L> DoAt <L> (RCClosure closure, RCVector <L> left, RCVector <decimal> right) { L[] result = new L[right.Count]; for (int i = 0; i < right.Count; ++i) { if (right[i] < 0) { int j = (int)(left.Count + right[i]); if (j < 0 || j >= left.Count) { throw RCException.Range(closure, (long)right[i], left.Count); } result[i] = left[j]; } else { int j = (int)right[i]; if (j < 0 || j >= left.Count) { throw RCException.Range(closure, (long)right[i], left.Count); } result[i] = left[j]; } } return((RCVector <L>)RCVectorBase.FromArray(new RCArray <L> (result))); }
public static RCVector <L> DoAt <L> (RCClosure closure, RCVector <L> left, RCVector <byte> right) { L[] result = new L[right.Count]; for (int i = 0; i < right.Count; ++i) { int j = right[i]; if (j < 0 || j >= left.Count) { throw RCException.Range(closure, right[i], left.Count); } result[i] = left[j]; } return((RCVector <L>)RCVectorBase.FromArray(new RCArray <L> (result))); }