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.ToString()] = 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); }
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); }
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 <IoObject> 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)); }
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; }
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.ToString()] = slotValue; } else { Console.WriteLine("Slot {0} not found. Must define slot using := operator before updating.", slotName.value); } return(slotValue); }
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); }
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; }
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; }