本文整理汇总了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;
}
示例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;
}
示例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;
}