예제 #1
0
        public static object operator *(int n, PythonBuffer b)
        {
            PythonContext context = PythonContext.GetContext(b._context);

            return(context.Operation(
                       PythonOperationKind.Multiply,
                       PythonOps.GetIndex(b._context, b._object, b.GetSlice()),
                       n
                       ));
        }
예제 #2
0
        public static object operator *(PythonBuffer b, int n)
        {
            PythonContext context = b._context.LanguageContext;

            return(context.Operation(
                       PythonOperationKind.Multiply,
                       PythonOps.GetIndex(b._context, b._object, b.GetSlice()),
                       n
                       ));
        }
예제 #3
0
        public static object operator +(PythonBuffer a, PythonBuffer b)
        {
            PythonContext context = PythonContext.GetContext(a._context);

            return(context.Operation(
                       PythonOperationKind.Add,
                       PythonOps.GetIndex(a._context, a._object, a.GetSlice()),
                       PythonOps.GetIndex(a._context, b._object, b.GetSlice())
                       ));
        }
예제 #4
0
파일: IterTools.cs 프로젝트: nieve/ironruby
 private static IEnumerator<object> ObjectYielder(PythonContext context, count c, object start, object step) {
     start = context.Operation(PythonOperationKind.Add, start, step);
     for (; ; start = context.Operation(PythonOperationKind.Add, start, step)) {
         object prev = c._cur;
         c._cur = start;
         yield return prev;
     }
 }