localsProto() public method

public localsProto ( IoState state ) : IoObject
state IoState
return IoObject
コード例 #1
0
ファイル: IoState.cs プロジェクト: stangelandcl/io-clr
        public IoState()
        {
            objectProto = IoObject.createProto(this);
            core = objectProto.clone(this);
            lobby = objectProto.clone(this);

            IoSeq seqProto = IoSeq.createProto(this);

            setupSingletons();
            setupSymbols();

            objectProto.protoFinish(this);

            IoMessage messageProto = IoMessage.createProto(this);

            nilMessage = IoMessage.createObject(this) as IoMessage;
            nilMessage.cachedResult = ioNil;
            nilMessage.messageName = IOSYMBOL("nil");

            IoMap mapProto = IoMap.createProto(this);
            IoNumber numProto = IoNumber.createProto(this);
            IoCFunction cfProto = IoCFunction.createProto(this);
            IoBlock blockProto = IoBlock.createProto(this);
            //IoCoroutine coroProto = IoCoroutine.createProto(this);
            //mainCoroutine = coroProto;
            //currentCoroutine = coroProto;
            IoCall callProto = IoCall.createProto(this);
            IoList listProto = IoList.createProto(this);
            clrProto = IoCLR.createProto(this);
            IoCLRAssembly asmProto = IoCLRAssembly.createProto(this);
            IoCLRObject clrObjProto = IoCLRObject.createProto(this);

            IoObject protos = objectProto.clone(this);
            protos.slots["Core"] = core;
            protos.slots["Addons"] = null;

            lobby.slots["Lobby"] = lobby;
            lobby.slots["Protos"] = protos;

            core.slots["Object"] = objectProto;
            core.slots["Map"] = mapProto;
               // core.slots["Coroutine"] = coroProto;
            core.slots["Message"] = messageProto;
            core.slots["CFunction"] = cfProto;
            core.slots["Number"] = numProto;
            core.slots["Block"] = blockProto;
            core.slots["Call"] = callProto;
            core.slots["Locals"] = localsProto = objectProto.localsProto(this);
            core.slots["List"] = listProto;
            core.slots["Sequence"] = seqProto;
            core.slots["CLR"] = clrProto;
            core.slots["CLRAssembly"] = asmProto;
            core.slots["CLRObject"] = clrObjProto;

            objectProto.protos.Add(lobby);
            lobby.protos.Add(protos);
            protos.protos.Add(core);

            localsUpdateSlotCFunc = new IoCFunction(this, "localsUpdate", IoObject.localsUpdateSlot);

            initMessage = IoMessage.newWithName(this, IOSYMBOL("init"));
            forwardMessage = IoMessage.newWithName(this, IOSYMBOL("forward"));
            activateMessage = IoMessage.newWithName(this, IOSYMBOL("activate"));
            selfMessage = IoMessage.newWithName(this, IOSYMBOL("self"));
            opShuffleMessage = IoMessage.newWithName(this, IOSYMBOL("opShuffle"));
            mainMessage = IoMessage.newWithName(this, IOSYMBOL("main"));
            typeMessage = IoMessage.newWithName(this, IOSYMBOL("type"));
        }
コード例 #2
0
        public IoState()
        {
            objectProto = IoObject.createProto(this);
            core        = objectProto.clone(this);
            lobby       = objectProto.clone(this);

            IoSeq seqProto = IoSeq.createProto(this);

            setupSingletons();
            setupSymbols();

            objectProto.protoFinish(this);

            IoMessage messageProto = IoMessage.createProto(this);

            nilMessage = IoMessage.createObject(this) as IoMessage;
            nilMessage.cachedResult = ioNil;
            nilMessage.messageName  = IOSYMBOL("nil");

            IoMap       mapProto   = IoMap.createProto(this);
            IoNumber    numProto   = IoNumber.createProto(this);
            IoCFunction cfProto    = IoCFunction.createProto(this);
            IoBlock     blockProto = IoBlock.createProto(this);
            //IoCoroutine coroProto = IoCoroutine.createProto(this);
            //mainCoroutine = coroProto;
            //currentCoroutine = coroProto;
            IoCall callProto = IoCall.createProto(this);
            IoList listProto = IoList.createProto(this);

            clrProto = IoCLR.createProto(this);
            IoCLRAssembly asmProto    = IoCLRAssembly.createProto(this);
            IoCLRObject   clrObjProto = IoCLRObject.createProto(this);

            IoObject protos = objectProto.clone(this);

            protos.slots["Core"]   = core;
            protos.slots["Addons"] = null;

            lobby.slots["Lobby"]  = lobby;
            lobby.slots["Protos"] = protos;

            core.slots["Object"] = objectProto;
            core.slots["Map"]    = mapProto;
            // core.slots["Coroutine"] = coroProto;
            core.slots["Message"]     = messageProto;
            core.slots["CFunction"]   = cfProto;
            core.slots["Number"]      = numProto;
            core.slots["Block"]       = blockProto;
            core.slots["Call"]        = callProto;
            core.slots["Locals"]      = localsProto = objectProto.localsProto(this);
            core.slots["List"]        = listProto;
            core.slots["Sequence"]    = seqProto;
            core.slots["CLR"]         = clrProto;
            core.slots["CLRAssembly"] = asmProto;
            core.slots["CLRObject"]   = clrObjProto;

            objectProto.protos.Add(lobby);
            lobby.protos.Add(protos);
            protos.protos.Add(core);

            localsUpdateSlotCFunc = new IoCFunction(this, "localsUpdate", IoObject.localsUpdateSlot);

            initMessage      = IoMessage.newWithName(this, IOSYMBOL("init"));
            forwardMessage   = IoMessage.newWithName(this, IOSYMBOL("forward"));
            activateMessage  = IoMessage.newWithName(this, IOSYMBOL("activate"));
            selfMessage      = IoMessage.newWithName(this, IOSYMBOL("self"));
            opShuffleMessage = IoMessage.newWithName(this, IOSYMBOL("opShuffle"));
            mainMessage      = IoMessage.newWithName(this, IOSYMBOL("main"));
            typeMessage      = IoMessage.newWithName(this, IOSYMBOL("type"));
        }