本文整理汇总了C#中io.IoObject.rawGetSlot方法的典型用法代码示例。如果您正苦于以下问题:C# IoObject.rawGetSlot方法的具体用法?C# IoObject.rawGetSlot怎么用?C# IoObject.rawGetSlot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.IoObject
的用法示例。
在下文中一共展示了IoObject.rawGetSlot方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: localsUpdateSlot
public static IoObject localsUpdateSlot(IoObject target, IoObject locals, IoObject message)
{
IoMessage m = message as IoMessage;
IoSeq slotName = m.localsSymbolArgAt(locals, 0);
if (slotName == null) return target;
IoObject obj = target.rawGetSlot(slotName);
if (obj != null)
{
IoObject slotValue = m.localsValueArgAt(locals, 1);
target.slots[slotName] = slotValue;
return slotValue;
}
else
{
IoObject theSelf = target.rawGetSlot(target.state.selfMessage.messageName);
if (theSelf != null)
{
return theSelf.perform(theSelf, locals, m);
}
}
return target.state.ioNil;
}
示例2: slotAsyncCall
public static IoObject slotAsyncCall(IoObject target, IoObject locals, IoObject message)
{
IoMessage msg = message as IoMessage;
IoMessage aMessage = msg.rawArgAt(0);
IoObject context = target;
if (msg.args.Count >= 2)
{
context = msg.localsValueArgAt(locals, 1);
}
IoBlock o = target.rawGetSlot(aMessage.messageName) as IoBlock;
if (o != null)
{
IoMessage mmm = o.containedMessage;
mmm.async = true;
IoContext ctx = new IoContext();
ctx.target = context;
ctx.locals = target;
ctx.message = mmm;
mmm.async = true;
IoState state = target.state;
IoObject future = IoObject.createObject(state);
IEnumerator e = IoMessage.asyncCall(ctx, future);
state.contextList.Add(e);
return future;
}
else
{
IoCFunction cf = target.rawGetSlot(aMessage.messageName) as IoCFunction;
if (cf != null)
{
cf.async = true;
return cf.activate(target, locals, aMessage, null);
}
}
return aMessage.localsPerformOn(target, locals);
}
示例3: slotUpdateSlot
public static IoObject slotUpdateSlot(IoObject target, IoObject locals, IoObject message)
{
IoMessage m = message as IoMessage;
IoSeq slotName = m.localsSymbolArgAt(locals, 0);
IoObject slotValue = m.localsValueArgAt(locals, 1);
if (slotName == null) return target;
if (target.rawGetSlot(slotName) != null)
{
target.slots[slotName] = slotValue;
}
else
{
Console.WriteLine("Slot {0} not found. Must define slot using := operator before updating.", slotName.value);
}
return slotValue;
}
示例4: slotGetSlot
public static IoObject slotGetSlot(IoObject target, IoObject locals, IoObject message)
{
IoMessage m = message as IoMessage;
IoSeq slotName = m.localsSymbolArgAt(locals, 0);
IoObject slot = target.rawGetSlot(slotName);
return slot == null ? target.state.ioNil : slot;
}