rawGetSlot() 공개 메소드

public rawGetSlot ( IoSeq slot ) : IoObject
slot IoSeq
리턴 IoObject
예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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));
        }
예제 #4
0
파일: IoObject.cs 프로젝트: devaspot/io
 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;
 }
예제 #5
0
        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);
        }
예제 #6
0
파일: IoObject.cs 프로젝트: devaspot/io
        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);
        }
예제 #7
0
파일: IoObject.cs 프로젝트: devaspot/io
        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;
        }
예제 #8
0
파일: IoObject.cs 프로젝트: devaspot/io
 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;
 }