當前位置: 首頁>>代碼示例>>C#>>正文


C# IoObject.rawGetSlot方法代碼示例

本文整理匯總了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;
 }
開發者ID:devaspot,項目名稱:io,代碼行數:22,代碼來源:IoObject.cs

示例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);
        }
開發者ID:devaspot,項目名稱:io,代碼行數:38,代碼來源:IoObject.cs

示例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;
        }
開發者ID:devaspot,項目名稱:io,代碼行數:18,代碼來源:IoObject.cs

示例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;
 }
開發者ID:devaspot,項目名稱:io,代碼行數:7,代碼來源:IoObject.cs


注:本文中的io.IoObject.rawGetSlot方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。