Inheritance: IDuplicable
コード例 #1
1
 internal RubyLambdaMethodInfo(Proc/*!*/ block, string/*!*/ definitionName, RubyMemberFlags flags, RubyModule/*!*/ declaringModule) 
     : base(flags, declaringModule) {
     Assert.NotNull(block, definitionName, declaringModule);
     _lambda = block.ToLambda(this);
     _definitionName = definitionName;
     _id = Interlocked.Increment(ref _Id);
 }
コード例 #2
0
 public static object MethodRetry(RubyScope/*!*/ scope, Proc proc) {
     if (proc != null) {
         return RetrySingleton;
     } else {
         throw new LocalJumpError("retry used out of rescue", scope.FlowControlScope);
     }
 }
コード例 #3
0
        public void OverloadResolution_Block1() {
            var scope = Context.EmptyScope;
            var proc = new Proc(ProcKind.Proc, null, scope, new BlockDispatcher0(BlockSignatureAttributes.None, null, 0).
                SetMethod(new BlockCallTarget0((x, y) => null)));

            var arguments = new[] {
                // 1.times
                new CallArguments(Context, MO(scope), new[] { MO(1) }, RubyCallSignature.WithScope(0)),
                // 1.times &nil             
                new CallArguments(Context, MO(scope), new[] {  MO(1), MO(null) }, RubyCallSignature.WithScopeAndBlock(0)),
                // 1.times &p                            
                new CallArguments(Context, MO(1), new[] {  MO(proc) }, RubyCallSignature.WithBlock(0)),
                // obj.times &p                          
                new CallArguments(Context, MO("foo"), new[] {  MO(proc) }, RubyCallSignature.WithBlock(0)),
            };

            var results = new[] {
                "Times2",
                "Times1",
                "Times3",
                "Times4",
            };

            var metaBuilder = new MetaObjectBuilder(null);
            for (int i = 0; i < arguments.Length; i++) {
                RubyOverloadResolver resolver;
                var bindingTarget = RubyMethodGroupInfo.ResolveOverload(
                    metaBuilder, arguments[i], "times", GetStaticMethods(typeof(OverloadsWithBlock), "Times*"), SelfCallConvention.SelfIsParameter,
                    false, out resolver
                );

                Assert(bindingTarget.Success);
                Assert(bindingTarget.Method.Name == results[i]);
            }
        }
コード例 #4
0
 public RubyImportDefinition(string contractName, Proc mutator)
     : base(contractName, null, null, ImportCardinality.ZeroOrOne, false, true, System.ComponentModel.Composition.CreationPolicy.Any)
 {
     if (mutator == null)
         throw new ArgumentNullException("mutator");
     _mutator = mutator;
 }
コード例 #5
0
ファイル: Proc.Subclass.cs プロジェクト: TerabyteX/main
 // called by Proc#new rule when creating a Ruby subclass of Proc:
 public Subclass(RubyClass/*!*/ rubyClass, Proc/*!*/ proc)
     : base(proc)
 {
     Assert.NotNull(rubyClass);
     Debug.Assert(!rubyClass.IsSingletonClass);
     ImmediateClass = rubyClass;
 }
コード例 #6
0
 public static object MethodRetry(RuntimeFlowControl/*!*/ rfc, Proc proc) {
     if (proc != null) {
         return RetrySingleton;
     } else {
         throw new LocalJumpError("retry used out of rescue", rfc);
     }
 }
コード例 #7
0
ファイル: Enumerable.cs プロジェクト: mscottford/ironruby
 private static object Each(RubyContext/*!*/ context, object self, Proc/*!*/ block) {
     if (self is Enumerator) {
         return ((Enumerator)self).Each(context, block);
     } else {
         return RubySites.Each(context, self, block);
     }
 }
コード例 #8
0
ファイル: Enumerable.cs プロジェクト: joshholmes/ironruby
 private static object Each(CallSiteStorage<EachSite>/*!*/ each, RubyContext/*!*/ context, object self, Proc/*!*/ block) {
     var enumerator = self as Enumerator;
     if (enumerator != null) {
         return enumerator.Each(context, block);
     } else {
         var site = each.GetCallSite("each", RubyCallSignature.WithBlock(0));
         return site.Target(site, context, self, block);
     }
 }
コード例 #9
0
 public static object MethodRetry(RubyScope/*!*/ scope, Proc proc) {
     if (proc != null) {
         return BlockReturnResult.Retry;
     } else {
         // TODO: can this happen? 
         // If proc was null then the block argument passed to the call-with-block that returned RetrySingleton would be null and thus 
         // the call cannot yield to any block that retries.
         throw new LocalJumpError("retry used out of rescue", scope.FlowControlScope);
     }
 }
コード例 #10
0
ファイル: RubyPart.cs プロジェクト: JogoShugh/IronRubyMef
        public RubyPart(RubyPartDefinition definition, Proc createInstance)
        {
            if (definition == null)
                throw new ArgumentNullException("definition");
            if (createInstance == null)
                throw new ArgumentNullException("createInstance");

            _definition = definition;
            _instance = new DelayedInit<object>(() => createInstance.Call(createInstance));
        }
コード例 #11
0
        public static RuntimeFlowControl/*!*/ CreateRfcForMethod(Proc proc) {
            RuntimeFlowControl result = new RuntimeFlowControl();
            result.IsActiveMethod = true;

            if (proc != null && proc.Kind == ProcKind.Block) {
                proc.Kind = ProcKind.Proc;
                proc.Converter = result;
            }

            return result;
        }
コード例 #12
0
        public RubyPartDefinition(string displayName, Proc createPart)
        {
            if (createPart == null)
                throw new ArgumentNullException("createPart");

            if (displayName == null)
                throw new ArgumentNullException("displayName");

            _createPart = createPart;
            _displayName = displayName;
        }
コード例 #13
0
ファイル: Signal.cs プロジェクト: rudimk/dlr-dotnet
        public static object Trap(
            RubyContext/*!*/ context, 
            object self, 
            object signalId, 
            Proc proc) {

            if ((signalId is MutableString) && ((MutableString)signalId).ConvertToString() == "INT") {
                context.InterruptSignalHandler = delegate() { proc.Call(); };
            } else {
                // TODO: For now, just ignore unknown signals. This should be changed to throw an
                // exception. We are not doing it yet as it is close to the V1 RTM, and throwing
                // an exception might cause some app to misbehave whereas it might have happenned
                // to work if no exception is thrown
            }
            return null;
        }
コード例 #14
0
ファイル: ProcOps.cs プロジェクト: jxnmaomao/ironruby
        public static MutableString/*!*/ ToS(Proc/*!*/ self) {
            var context = self.LocalScope.RubyContext;

            var str = RubyUtils.ObjectToMutableStringPrefix(context, self);
            str.Append('@');
            str.Append(self.SourcePath ?? "(unknown)");
            str.Append(':');
            str.Append(self.SourceLine.ToString());

            if (context.RubyOptions.Compatibility >= RubyCompatibility.Ruby19 && self.Kind == ProcKind.Lambda) {
                str.Append(" (lambda)"); 
            }

            str.Append('>');

            return str;
        }
コード例 #15
0
        public void OverloadResolution_Block() {
            var t = GetType();

            var gse = new RubyGlobalScope(Context, new Scope(), new object(), true);
            var scope = new RubyTopLevelScope(gse, null, new SymbolDictionary());
            var proc = new Proc(ProcKind.Proc, null, scope, new BlockDispatcher0((x, y) => null, BlockSignatureAttributes.None));

            var scopeArg = new DynamicMetaObject(Ast.Constant(proc.LocalScope), BindingRestrictions.Empty, proc.LocalScope);
            var contextArg = new DynamicMetaObject(Ast.Constant(Context), BindingRestrictions.Empty, Context);
            var instanceInt = new DynamicMetaObject(Ast.Constant(1), BindingRestrictions.Empty, 1);
            var str = "foo";
            var instanceStr = new DynamicMetaObject(Ast.Constant(str), BindingRestrictions.Empty, str);
            var procArg = new DynamicMetaObject(Ast.Constant(proc), BindingRestrictions.Empty, proc);
            var nullArg = new DynamicMetaObject(Ast.Constant(Ast.Constant(null)), BindingRestrictions.Empty, null);

            var arguments = new[] {
                // 1.times
                new CallArguments(scopeArg, instanceInt, new DynamicMetaObject[0], RubyCallSignature.WithScope(0)),
                // 1.times &nil             
                new CallArguments(scopeArg, instanceInt, new[] {  nullArg }, RubyCallSignature.WithScopeAndBlock(0)),
                // 1.times &p                            
                new CallArguments(contextArg, instanceInt, new[] {  procArg }, RubyCallSignature.WithBlock(0)),
                // obj.times &p                          
                new CallArguments(contextArg, instanceStr, new[] {  procArg }, RubyCallSignature.WithBlock(0)),
            };

            var results = new[] {
                "Times2",
                "Times1",
                "Times3",
                "Times4",
            };

            for (int i = 0; i < arguments.Length; i++) {
                var bindingTarget = RubyMethodGroupInfo.ResolveOverload("times", new[] {
                    t.GetMethod("Times1"),
                    t.GetMethod("Times2"),
                    t.GetMethod("Times3"),
                    t.GetMethod("Times4"),
                }, arguments[i], true, false);

                Assert(bindingTarget.Success);
                Assert(bindingTarget.Method.Name == results[i]);
            }
        }
コード例 #16
0
ファイル: ModuleOps.cs プロジェクト: ltwlf/IronSP
        public static Proc /*!*/ DefineMethod(RubyScope /*!*/ scope, RubyModule /*!*/ self,
                                              [DefaultProtocol, NotNull] string /*!*/ methodName, [NotNull] Proc /*!*/ block)
        {
            var visibility = GetDefinedMethodVisibility(scope, self, methodName);
            var info       = Proc.ToLambdaMethodInfo(block, methodName, visibility, self);

            self.AddMethod(scope.RubyContext, methodName, info);
            return(info.Lambda);
        }
コード例 #17
0
        public static object Load(RubyScope /*!*/ scope, RubyModule /*!*/ self, [NotNull] RubyIO /*!*/ source, [Optional] Proc proc)
        {
            BinaryReader  reader = source.GetBinaryReader();
            MarshalReader loader = new MarshalReader(reader, scope.RubyContext, scope.GlobalScope, proc);

            return(loader.Load());
        }
コード例 #18
0
 public static Proc /*!*/ ToProc(Proc /*!*/ self)
 {
     return(self);
 }
コード例 #19
0
        public static object Load(RubyScope /*!*/ scope, RubyModule /*!*/ self, object source, [Optional] Proc proc)
        {
            Stream stream = null;

            if (source != null)
            {
                stream = new IOWrapper(self.Context, source, FileAccess.Read);
            }
            if (stream == null || !stream.CanRead)
            {
                throw RubyExceptions.CreateTypeError("instance of IO needed");
            }
            BinaryReader  reader = new BinaryReader(stream);
            MarshalReader loader = new MarshalReader(reader, scope.RubyContext, scope.GlobalScope, proc);

            return(loader.Load());
        }
コード例 #20
0
        internal static object Each(CallSiteStorage <EachSite> /*!*/ each, object self, Proc /*!*/ block)
        {
            var site = each.GetCallSite("each", new RubyCallSignature(0, RubyCallFlags.HasImplicitSelf | RubyCallFlags.HasBlock));

            return(site.Target(site, self, block));
        }
コード例 #21
0
 public static object Call(Proc /*!*/ self, params object[] /*!*/ args)
 {
     RequireParameterCount(self, args.Length);
     return(self.CallN(args));
 }
コード例 #22
0
ファイル: ProcOps.cs プロジェクト: jxnmaomao/ironruby
 public static Proc/*!*/ Clone(Proc/*!*/ self) {
     return self.Copy();
 }
コード例 #23
0
ファイル: Proc.cs プロジェクト: gaybro8777/ironruby
 protected Proc(Proc /*!*/ proc)
     : this(proc.Kind, proc.Self, proc.LocalScope, proc.Dispatcher)
 {
     _owner     = proc._owner;
     _converter = proc._converter;
 }
コード例 #24
0
ファイル: Signal.cs プロジェクト: ltwlf/IronSP
 public static object Trap(RubyContext /*!*/ context, object self, object signalId, Proc proc)
 {
     // TODO: For now, just ignore the signal handler. The full implementation will need to build on
     // the signal and raise functions in msvcrt.
     return(null);
 }
コード例 #25
0
ファイル: Proc.cs プロジェクト: gaybro8777/ironruby
 /// <summary>
 /// Creates a copy of the proc that has the same target, context and self object as this block.
 /// </summary>
 public Proc /*!*/ Create(Proc /*!*/ proc)
 {
     return(new Proc(proc));
 }
コード例 #26
0
ファイル: Proc.cs プロジェクト: gaybro8777/ironruby
 public static RubyMemberInfo /*!*/ ToLambdaMethodInfo(Proc /*!*/ lambda, string /*!*/ definitionName, RubyMethodVisibility visibility,
                                                       RubyModule /*!*/ owner)
 {
     return(new RubyLambdaMethodInfo(lambda, definitionName, (RubyMemberFlags)visibility, owner));
 }
コード例 #27
0
        public static object Zip(CallSiteStorage <EachSite> /*!*/ each, ConversionStorage <IList> /*!*/ tryToAry, CallSiteStorage <EachSite> /*!*/ otherEach, BlockParam block, object self, [DefaultProtocol, NotNullItems] params object /*!*/[] /*!*/ args)
        {
            RubyArray results = (block == null) ? new RubyArray() : null;
            object    result  = results;

            // coerce the args into arrays
            var coercedArgs = new List <IList>(args.Length);

            foreach (var otherArrayObject in args)
            {
                IList otherArray = Protocols.TryCastToArray(tryToAry, otherArrayObject);
                if (otherArray != null)
                {
                    coercedArgs.Add(otherArray);
                }
                else     // added in MRI 1.9.2 - if to_ary fails, try call .each to extract values
                {
                    otherArray = new List <object>();
                    Each(otherEach, otherArrayObject, Proc.Create(otherEach.Context, delegate(BlockParam /*!*/ selfBlock, object _, object item) {
                        otherArray.Add(item);
                        return(null);
                    }));
                    coercedArgs.Add(otherArray);
                }
            }


            int index = 0;

            Each(each, self, Proc.Create(each.Context, delegate(BlockParam /*!*/ selfBlock, object _, object item) {
                // Collect items
                RubyArray array = new RubyArray(args.Length + 1);
                array.Add(item);
                foreach (var otherArray in coercedArgs)
                {
                    if (index < otherArray.Count)
                    {
                        array.Add(otherArray[index]);
                    }
                    else
                    {
                        array.Add(null);
                    }
                }

                index += 1;

                if (block != null)
                {
                    object blockResult;
                    if (block.Yield(array, out blockResult))
                    {
                        result = blockResult;
                        return(selfBlock.PropagateFlow(block, blockResult));
                    }
                }
                else
                {
                    results.Add(array);
                }
                return(null);
            }));

            return(result);
        }
コード例 #28
0
        public static object GetExtremes(CallSiteStorage <EachSite> /*!*/ each, ComparisonStorage /*!*/ comparisonStorage, BlockParam comparer, object self)
        {
            bool   hasOddItem = false, hasMinMax = false, blockJumped = false;
            object oddItem     = null;
            object blockResult = null;

            object min = null, max = null;

            Func <IronRuby.Runtime.BlockParam, object, object, object> blockProc = delegate(BlockParam /*!*/ selfBlock, object _, object item) {
                if (hasOddItem)
                {
                    hasOddItem = false;

                    int?compareResult = CompareItems(comparisonStorage, oddItem, item, comparer, out blockResult);
                    if (compareResult == null)
                    {
                        goto BlockJumped;
                    }
                    if (compareResult > 0)
                    {
                        // oddItem > item
                        object obj = item;
                        item    = oddItem;
                        oddItem = obj;
                    }

                    // oddItem <= item
                    if (hasMinMax)
                    {
                        compareResult = CompareItems(comparisonStorage, oddItem, min, comparer, out blockResult);
                        if (compareResult == null)
                        {
                            goto BlockJumped;
                        }
                        if (compareResult < 0)
                        {
                            // oddItem < min
                            min = oddItem;
                        }

                        compareResult = CompareItems(comparisonStorage, item, max, comparer, out blockResult);
                        if (compareResult == null)
                        {
                            goto BlockJumped;
                        }
                        if (compareResult > 0)
                        {
                            // item > max
                            max = item;
                        }
                    }
                    else
                    {
                        min       = oddItem;
                        max       = item;
                        hasMinMax = true;
                    }
                }
                else
                {
                    hasOddItem = true;
                    oddItem    = item;
                }

                return(null);

BlockJumped:
                blockJumped = true;
                return(selfBlock.PropagateFlow(comparer, blockResult));
            };

            Each(each, self, Proc.Create(each.Context, blockProc));

            if (blockJumped)
            {
                return(blockResult);
            }

            if (!hasMinMax)
            {
                return(hasOddItem ? new RubyArray(2)
                {
                    oddItem, oddItem
                } : new RubyArray(2)
                {
                    null, null
                });
            }

            if (hasOddItem)
            {
                int?compareResult = CompareItems(comparisonStorage, oddItem, min, comparer, out blockResult);
                if (compareResult == null)
                {
                    return(blockResult);
                }
                if (compareResult < 0)
                {
                    min = oddItem;
                }

                compareResult = CompareItems(comparisonStorage, oddItem, max, comparer, out blockResult);
                if (compareResult == null)
                {
                    return(blockResult);
                }
                if (compareResult > 0)
                {
                    max = oddItem;
                }
            }

            return(new RubyArray(2)
            {
                min, max
            });
        }
コード例 #29
0
        internal static object Each(CallSiteStorage <EachSiteN> /*!*/ each, object self, IList /*!*/ args, Proc /*!*/ block)
        {
            var site = each.GetCallSite("each", new RubyCallSignature(0, RubyCallFlags.HasImplicitSelf | RubyCallFlags.HasBlock | RubyCallFlags.HasSplattedArgument));

            return(site.Target(site, self, block, args));
        }
コード例 #30
0
 public static bool Equal(Proc /*!*/ self, object other)
 {
     return(false);
 }
コード例 #31
0
ファイル: ProcOps.cs プロジェクト: jxnmaomao/ironruby
 public static object Call(Proc/*!*/ self, object arg1) {
     RequireParameterCount(self, 1);
     return self.Call(arg1);
 }   
コード例 #32
0
 public static bool Equal(Proc /*!*/ self, [NotNull] Proc /*!*/ other)
 {
     return(self.Dispatcher == other.Dispatcher && self.LocalScope == other.LocalScope && self.Kind == other.Kind);
 }
コード例 #33
0
ファイル: KernelOps.cs プロジェクト: aceptra/ironruby
 public static object Trap(RubyContext/*!*/ context, object self, object signalId, Proc proc) {
     return Signal.Trap(context, self, signalId, proc);
 }
コード例 #34
0
 internal MarshalReader(BinaryReader /*!*/ reader, RubyContext /*!*/ context, Scope /*!*/ globalScope, Proc proc)
 {
     _reader      = reader;
     _context     = context;
     _globalScope = globalScope;
     _proc        = proc;
     _symbols     = new Dictionary <int, string>();
     _objects     = new Dictionary <int, object>();
 }
コード例 #35
0
ファイル: RubyScope.cs プロジェクト: jxnmaomao/ironruby
 internal void InitializeRfc(Proc proc) {
     if (proc != null && proc.Kind == ProcKind.Block) {
         proc.Kind = ProcKind.Proc;
         proc.Converter = this;
     }
 }
コード例 #36
0
ファイル: ProcOps.cs プロジェクト: jxnmaomao/ironruby
 public static Proc/*!*/ ToProc(Proc/*!*/ self) {
     return self;
 }
コード例 #37
0
ファイル: Enumerable.cs プロジェクト: rafacv/iron_languages
 internal static object Each(CallSiteStorage<EachSiteN>/*!*/ each, object self, IList/*!*/ args, Proc/*!*/ block) {
     var site = each.GetCallSite("each", new RubyCallSignature(0, RubyCallFlags.HasImplicitSelf | RubyCallFlags.HasBlock | RubyCallFlags.HasSplattedArgument));
     return site.Target(site, self, block, args);
 }
コード例 #38
0
ファイル: ProcOps.cs プロジェクト: jxnmaomao/ironruby
 public static object Call(Proc/*!*/ self) {
     RequireParameterCount(self, 0);
     return self.Call();
 }
コード例 #39
0
 public static Binding /*!*/ GetLocalScope(Proc /*!*/ self)
 {
     return(new Binding(self.LocalScope));
 }
コード例 #40
0
ファイル: ObjectSpace.cs プロジェクト: rudimk/dlr-dotnet
 public static object DefineFinalizer(RubyModule/*!*/ self, object obj, Proc proc) {
     RubyArray result = new RubyArray(2);
     result.Add(0);
     result.Add(proc);
     return result;
 }
コード例 #41
0
 public static object Call(Proc /*!*/ self, object arg1)
 {
     RequireParameterCount(self, 1);
     return(self.Call(arg1));
 }
コード例 #42
0
ファイル: KernelOps.cs プロジェクト: aceptra/ironruby
 public static Proc SetTraceListener(RubyContext/*!*/ context, object self, Proc listener) {
     if (listener != null && !context.RubyOptions.EnableTracing) {
         throw new NotSupportedException("Tracing is not supported unless -trace option is specified.");
     }
     return context.TraceListener = listener;
 }
コード例 #43
0
ファイル: Proc.cs プロジェクト: kevinkeeney/ironruby
 protected Proc(Proc/*!*/ proc)
     : this(proc.Kind, proc.Self, proc.LocalScope, proc.Dispatcher) {
     Converter = proc.Converter;
 }
コード例 #44
0
ファイル: RubyScope.cs プロジェクト: jxnmaomao/ironruby
        internal RubyMethodScope(MutableTuple locals, SymbolId[]/*!*/ variableNames, 
            RubyScope/*!*/ parent, RubyModule/*!*/ declaringModule, string/*!*/ definitionName,
            object selfObject, Proc blockParameter, InterpretedFrame interpretedFrame) {
            Assert.NotNull(parent, declaringModule, definitionName);

            // RuntimeFlowControl:
            _activeFlowControlScope = this;
            
            // RubyScope:
            _parent = parent;
            _top = parent.Top;
            _selfObject = selfObject;
            _methodAttributes = RubyMethodAttributes.PublicInstance;
            _locals = locals;
            _variableNames = variableNames;
            InterpretedFrame = interpretedFrame;
            
            // RubyMethodScope:
            _declaringModule = declaringModule;
            _definitionName = definitionName;
            _blockParameter = blockParameter;

            InitializeRfc(blockParameter);
            SetDebugName("method " + definitionName + ((blockParameter != null) ? "&" : null));
        }
コード例 #45
0
ファイル: Proc.cs プロジェクト: kevinkeeney/ironruby
 /// <summary>
 /// Creates a lambda Proc that has the same target, context and self object as this block.
 /// Doesn't preserve the class of the Proc.
 /// </summary>
 public Proc/*!*/ ToLambda(RubyLambdaMethodInfo method) {
     Proc result = new Proc(this);
     result.Kind = ProcKind.Lambda;
     result._method = method;
     return result;
 }
コード例 #46
0
 public static object Call(Proc /*!*/ self, object arg1, object arg2, object arg3, object arg4)
 {
     RequireParameterCount(self, 4);
     return(self.Call(arg1, arg2, arg3, arg4));
 }
コード例 #47
0
        public static object Load(RubyScope /*!*/ scope, RubyModule /*!*/ self, [NotNull] MutableString /*!*/ source, [Optional] Proc proc)
        {
            BinaryReader  reader = new BinaryReader(new MemoryStream(source.ConvertToBytes()));
            MarshalReader loader = new MarshalReader(reader, scope.RubyContext, scope.GlobalScope, proc);

            return(loader.Load());
        }
コード例 #48
0
ファイル: Proc.cs プロジェクト: kevinkeeney/ironruby
 /// <summary>
 /// Creates a copy of the proc that has the same target, context and self object as this block.
 /// </summary>
 public Proc/*!*/ Create(Proc/*!*/ proc) {
     return new Proc(proc);
 }
コード例 #49
0
 public static int GetArity(Proc /*!*/ self)
 {
     return(self.Dispatcher.Arity);
 }
コード例 #50
0
ファイル: Proc.cs プロジェクト: kevinkeeney/ironruby
 public static RubyLambdaMethodInfo/*!*/ ToLambdaMethodInfo(Proc/*!*/ block, string/*!*/ definitionName, RubyMethodVisibility visibility,
     RubyModule/*!*/ owner) {
     return new RubyLambdaMethodInfo(block, definitionName, (RubyMemberFlags)visibility, owner);
 }
コード例 #51
0
 public static Proc /*!*/ Clone(Proc /*!*/ self)
 {
     return(self.Copy());
 }
コード例 #52
0
ファイル: Enumerable.cs プロジェクト: Hank923/ironruby
 internal static object Each(CallSiteStorage<EachSite>/*!*/ each, object self, Proc/*!*/ block) {
     var site = each.GetCallSite("each", new RubyCallSignature(0, RubyCallFlags.HasImplicitSelf | RubyCallFlags.HasBlock));
     return site.Target(site, self, block);
 }
コード例 #53
0
 public static object Call(Proc /*!*/ self)
 {
     RequireParameterCount(self, 0);
     return(self.Call());
 }