当前位置: 首页>>代码示例>>C#>>正文


C# IoObject.perform方法代码示例

本文整理汇总了C#中io.IoObject.perform方法的典型用法代码示例。如果您正苦于以下问题:C# IoObject.perform方法的具体用法?C# IoObject.perform怎么用?C# IoObject.perform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.IoObject的用法示例。


在下文中一共展示了IoObject.perform方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: slotAsyncWhile

        public static IEnumerator slotAsyncWhile(IoObject target, IoObject locals, IoObject message, IoObject future)
        {
            IoMessage m = message as IoMessage;
            IoObject result = target.state.ioNil;
            IoObject cond = null;

            while (true)
            {
                cond = m.localsValueArgAt(locals, 0);
                //evaluateArgs(m, new EvaluateArgsEventArgs(0), out cond);

                if (cond == target.state.ioFalse || cond == target.state.ioNil)
                {
                    break;
                }

                //result = m.localsValueArgAt(locals, 1);
                //evaluateArgs(m, new EvaluateArgsEventArgs(1), out result);

                IoMessage msg = 1 < m.args.Count ? m.args[1] as IoMessage : null;
                if (msg != null)
                {
                    if (msg.cachedResult != null && msg.next == null)
                    {
                        result = msg.cachedResult;
                        yield return result;
                    }
                    //result = localMessage.localsPerformOn(locals, locals);

                    result = target;
                    IoObject cachedTarget = target;
                    IoObject savedPrevResultAsYieldResult = null;

                    do
                    {
                        if (msg.messageName.Equals(msg.state.semicolonSymbol))
                        {
                            target = cachedTarget;
                        }
                        else
                        {
                            result = msg.cachedResult;
                            if (result == null)
                            {
                                if (msg.messageName.value.Equals("yield"))
                                {
                                    yield return result;
                                }
                                else
                                {
                                    result = target.perform(target, locals, msg);
                                }
                            }
                            if (result == null)
                            {
                                target = cachedTarget;
                                //result = savedPrevResultAsYieldResult;
                            }
                            else
                            {
                                target = result;
                            }
                            savedPrevResultAsYieldResult = result;
                        }
                    } while ((msg = msg.next) != null);
                    future.slots["future"] = result;

                    yield return null;
                }

                result = m.state.ioNil;

                if (target.state.handleStatus() != 0)
                {
                    goto done;
                }

            }
            done:
            yield return null;
        }
开发者ID:devaspot,项目名称:io,代码行数:81,代码来源:IoObject.cs

示例2: slotLocalsForward

 public static IoObject slotLocalsForward(IoObject target, IoObject locals, IoObject message)
 {
     IoObject o = target.slots[target.state.selfSymbol] as IoObject;
     if (o != null && o != target)
         return target.perform(o, locals, message);
     return target.state.ioNil;
 }
开发者ID:devaspot,项目名称:io,代码行数:7,代码来源:IoObject.cs

示例3: localsPerformOn

        public IoObject localsPerformOn(IoObject target, IoObject locals)
        {
            if (async)
            {
                IoContext ctx = new IoContext();
                ctx.target = target;
                ctx.locals = locals;
                ctx.message = this;
                IoState state = target.state;
                IoObject future = IoObject.createObject(state);
                IEnumerator e = IoMessage.asyncCall(ctx, future);
                state.contextList.Add(e);
                return future;
            }

            IoObject result = target;
            IoObject cachedTarget = target;
            IoMessage msg = this;
            do
            {
                if (msg.messageName.Equals(msg.state.semicolonSymbol))
                {
                    target = cachedTarget;
                }
                else
                {
                    result = msg.cachedResult;
                    if (result == null)
                    {
                        //if (target.tag.performFunc == null)
                            result = target.perform(target, locals, msg);
                        //else
                        //    result = target.tag.performFunc(target, locals, msg);
                    }
                    if (result == null)
                    {
                        Console.WriteLine("Message chains intermediate mustn't be null");
                    }
                    target = result;
                }
            } while ((msg = msg.next) != null);
            return result;
        }
开发者ID:stangelandcl,项目名称:io-clr,代码行数:43,代码来源:IoMessage.cs


注:本文中的io.IoObject.perform方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。