本文整理匯總了C#中io.IoState.protoWithInitFunc方法的典型用法代碼示例。如果您正苦於以下問題:C# IoState.protoWithInitFunc方法的具體用法?C# IoState.protoWithInitFunc怎麽用?C# IoState.protoWithInitFunc使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類io.IoState
的用法示例。
在下文中一共展示了IoState.protoWithInitFunc方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: newWithDouble
public static IoNumber newWithDouble(IoState state, double n)
{
IoNumber fab = new IoNumber();
IoNumber num = state.protoWithInitFunc(fab.name) as IoNumber;
num = num.clone(state) as IoNumber;
num.isInteger = false;
num.doubleValue = n;
if (Double.Equals(n, 0) ||
(!Double.IsInfinity(n) && !Double.IsNaN(n) &&
!n.ToString(CultureInfo.InvariantCulture).Contains(".") &&
!n.ToString(CultureInfo.InvariantCulture).Contains("E") &&
!n.ToString(CultureInfo.InvariantCulture).Contains("e")
)
)
{
try
{
num.longValue = Convert.ToInt32(n);
num.isInteger = true;
}
catch (OverflowException oe)
{
}
}
return num;
}
示例2: clone
public override IoObject clone(IoState state)
{
IoCLRObject proto = state.protoWithInitFunc(name) as IoCLRObject;
IoCLRObject result = new IoCLRObject();
result.isActivatable = true;
uniqueIdCounter++;
result.uniqueId = uniqueIdCounter;
result.state = state;
result.createProtos();
result.createSlots();
result.protos.Add(proto);
return result;
}
示例3: proto
public override IoObject proto(IoState state)
{
IoMap pro = new IoMap();
pro.state = state;
pro.createSlots();
pro.createProtos();
pro.map = new Hashtable();
state.registerProtoWithFunc(pro.name, new IoStateProto(pro.name, pro, new IoStateProtoFunc(pro.proto)));
pro.protos.Add(state.protoWithInitFunc("Object"));
IoCFunction[] methodTable = new IoCFunction[] {
new IoCFunction("at", new IoMethodFunc(IoMap.slotAt)),
new IoCFunction("atPut", new IoMethodFunc(IoMap.slotAtPut)),
new IoCFunction("atIfAbsentPut", new IoMethodFunc(IoMap.slotAtIfAbsentPut)),
new IoCFunction("empty", new IoMethodFunc(IoMap.slotEmpty)),
new IoCFunction("size", new IoMethodFunc(IoMap.slotSize)),
new IoCFunction("removeAt", new IoMethodFunc(IoMap.slotRemoveAt)),
new IoCFunction("hasKey", new IoMethodFunc(IoMap.slotHasKey)),
new IoCFunction("hasValue", new IoMethodFunc(IoMap.slotHasValue)),
};
pro.addTaglessMethodTable(state, methodTable);
return pro;
}
示例4: proto
public override IoObject proto(IoState state)
{
IoCLRObject pro = new IoCLRObject();
pro.state = state;
pro.uniqueId = 0;
pro.createSlots();
pro.createProtos();
pro.isActivatable = true;
state.registerProtoWithFunc(pro.name, new IoStateProto(pro.name, pro, new IoStateProtoFunc(pro.proto)));
pro.protos.Add(state.protoWithInitFunc("Object"));
IoCFunction[] methodTable = new IoCFunction[] {
new IoCFunction("type", new IoMethodFunc(IoObject.slotType))
};
pro.addTaglessMethodTable(state, methodTable);
return pro;
}
示例5: proto
public override IoObject proto(IoState state)
{
IoString pro = new IoString();
pro.state = state;
// pro.tag.cloneFunc = new IoTagCloneFunc(this.clone);
// pro.tag.compareFunc = new IoTagCompareFunc(this.compare);
pro.createSlots();
pro.createProtos();
state.registerProtoWithFunc(name, new IoStateProto(name, pro, new IoStateProtoFunc(this.proto)));
pro.protos.Add(state.protoWithInitFunc("Object"));
IoCFunction[] methodTable = new IoCFunction[] {
new IoCFunction("appendStr", new IoMethodFunc(IoString.slotAppendStr)),
new IoCFunction("at", new IoMethodFunc(IoString.slotAt)),
new IoCFunction("reverse", new IoMethodFunc(IoString.slotReverse)),
};
pro.addTaglessMethodTable(state, methodTable);
return pro;
}
示例6: clone
public override IoObject clone(IoState state)
{
IoString proto = state.protoWithInitFunc(name) as IoString;
IoString result = new IoString();
result.state = state;
result.value = proto.value;
result.createProtos();
result.createSlots();
result.protos.Add(proto);
return result;
}
示例7: proto
public override IoObject proto(IoState state)
{
IoBlock pro = new IoBlock();
pro.state = state;
pro.createSlots();
pro.createProtos();
pro.containedMessage = state.nilMessage;
pro.argNames = new IoObjectArrayList();
state.registerProtoWithFunc(name, new IoStateProto(name, pro, new IoStateProtoFunc(this.proto)));
pro.protos.Add(state.protoWithInitFunc("Object"));
IoCFunction[] methodTable = new IoCFunction[] {
new IoCFunction("call", new IoMethodFunc(IoBlock.slotCall)),
new IoCFunction("code", new IoMethodFunc(IoBlock.slotCode)),
new IoCFunction("block", new IoMethodFunc(IoBlock.slotBlock)),
new IoCFunction("method", new IoMethodFunc(IoBlock.slotMethod)),
};
pro.addTaglessMethodTable(state, methodTable);
return pro;
}
示例8: protoFinish
// proto finish must be called only before first Sequence proto created
public IoObject protoFinish(IoState state)
{
IoCFunction[] methodTable = new IoCFunction[] {
new IoCFunction("compare", new IoMethodFunc(IoObject.slotCompare)),
new IoCFunction("==", new IoMethodFunc(IoObject.slotEquals)),
new IoCFunction("!=", new IoMethodFunc(IoObject.slotNotEquals)),
new IoCFunction(">=", new IoMethodFunc(IoObject.slotGreaterThanOrEqual)),
new IoCFunction("<=", new IoMethodFunc(IoObject.slotLessThanOrEqual)),
new IoCFunction(">", new IoMethodFunc(IoObject.slotGreaterThan)),
new IoCFunction("<", new IoMethodFunc(IoObject.slotLessThan)),
new IoCFunction("-", new IoMethodFunc(IoObject.slotSubstract)),
new IoCFunction("", new IoMethodFunc(IoObject.slotEevalArg)),
new IoCFunction("self", new IoMethodFunc(IoObject.slotSelf)),
new IoCFunction("clone", new IoMethodFunc(IoObject.slotClone)),
new IoCFunction("return", new IoMethodFunc(IoObject.slotReturn)),
new IoCFunction("cloneWithoutInit", new IoMethodFunc(IoObject.slotCloneWithoutInit)),
new IoCFunction("doMessage", new IoMethodFunc(IoObject.slotDoMessage)),
new IoCFunction("print", new IoMethodFunc(IoObject.slotPrint)),
new IoCFunction("println", new IoMethodFunc(IoObject.slotPrintln)),
new IoCFunction("slotNames", new IoMethodFunc(IoObject.slotSlotNames)),
new IoCFunction("type", new IoMethodFunc(IoObject.slotType)),
new IoCFunction("evalArg", new IoMethodFunc(IoObject.slotEevalArg)),
new IoCFunction("evalArgAndReturnSelf", new IoMethodFunc(IoObject.slotEevalArgAndReturnSelf)),
new IoCFunction("do", new IoMethodFunc(IoObject.slotDo)),
new IoCFunction("getSlot", new IoMethodFunc(IoObject.slotGetSlot)),
new IoCFunction("updateSlot", new IoMethodFunc(IoObject.slotUpdateSlot)),
new IoCFunction("setSlot", new IoMethodFunc(IoObject.slotSetSlot)),
new IoCFunction("setSlotWithType", new IoMethodFunc(IoObject.slotSetSlotWithType)),
new IoCFunction("message", new IoMethodFunc(IoObject.slotMessage)),
new IoCFunction("method", new IoMethodFunc(IoObject.slotMethod)),
new IoCFunction("block", new IoMethodFunc(IoObject.slotBlock)),
new IoCFunction("init", new IoMethodFunc(IoObject.slotSelf)),
new IoCFunction("thisContext", new IoMethodFunc(IoObject.slotSelf)),
new IoCFunction("thisMessage", new IoMethodFunc(IoObject.slotThisMessage)),
new IoCFunction("thisLocals", new IoMethodFunc(IoObject.slotThisLocals)),
new IoCFunction("init", new IoMethodFunc(IoObject.slotSelf)),
new IoCFunction("if", new IoMethodFunc(IoObject.slotIf)),
new IoCFunction("yield", new IoMethodFunc(IoObject.slotYield)),
new IoCFunction("@@", new IoMethodFunc(IoObject.slotAsyncCall)),
new IoCFunction("yieldingCoros", new IoMethodFunc(IoObject.slotYieldingCoros)),
new IoCFunction("while", new IoMethodFunc(IoObject.slotWhile))
};
IoObject o = state.protoWithInitFunc(name);
o.addTaglessMethodTable(state, methodTable);
return o;
}
示例9: clone
public virtual IoObject clone(IoState state)
{
IoObject proto = state.protoWithInitFunc(name);
IoObject o = Activator.CreateInstance(this.GetType()) as IoObject;//typeof(this)new IoObject();
uniqueIdCounter++;
o.uniqueId = uniqueIdCounter;
o.state = proto.state;
o.createSlots();
o.createProtos();
o.protos.Add(proto);
cloneSpecific(this, o);
return o;
}
示例10: proto
public override IoObject proto(IoState state)
{
IoCoroutine pro = new IoCoroutine();
pro.tag.state = state;
// pro.tag.cloneFunc = new IoTagCloneFunc(this.clone);
pro.createSlots();
pro.createProtos();
state.registerProtoWithFunc(name, new IoStateProto(name, pro, new IoStateProtoFunc(this.proto)));
pro.protos.Add(state.protoWithInitFunc("Object"));
IoCFunction[] methodTable = new IoCFunction[] {
new IoCFunction("run", new IoMethodFunc(IoCoroutine.slotRun)),
new IoCFunction("main", new IoMethodFunc(IoCoroutine.slotMain)),
new IoCFunction("resume", new IoMethodFunc(IoCoroutine.slotResume)),
new IoCFunction("isCurrent", new IoMethodFunc(IoCoroutine.slotIsCurrent)),
new IoCFunction("currentCoroutine", new IoMethodFunc(IoCoroutine.slotCurrentCoroutine)),
new IoCFunction("implementation", new IoMethodFunc(IoCoroutine.slotImplementation)),
new IoCFunction("setMessageDebugging", new IoMethodFunc(IoCoroutine.slotSetMessageDebugging)),
};
pro.addTaglessMethodTable(state, methodTable);
return pro;
}
示例11: clone
public override IoObject clone(IoState state)
{
IoCoroutine proto = state.protoWithInitFunc(name) as IoCoroutine;
IoCoroutine result = new IoCoroutine();
uniqueIdCounter++;
result.uniqueId = uniqueIdCounter;
result.tag = proto.tag;
result.createProtos();
result.createSlots();
result.protos.Add(proto);
return result;
}
示例12: proto
public override IoObject proto(IoState state)
{
IoMessage pro = new IoMessage();
pro.state = state;
// pro.tag.cloneFunc = new IoTagCloneFunc(this.clone);
//pro.tag.activateFunc = new IoTagActivateFunc(this.activate);
pro.createSlots();
pro.createProtos();
pro.uniqueId = 0;
pro.messageName = IoSeq.createSymbolInMachine(state, "anonymous");
pro.label = IoSeq.createSymbolInMachine(state, "unlabeled");
pro.args = new IoObjectArrayList();
state.registerProtoWithFunc(name, new IoStateProto(name, pro, new IoStateProtoFunc(this.proto)));
pro.protos.Add(state.protoWithInitFunc("Object"));
IoCFunction[] methodTable = new IoCFunction[] {
new IoCFunction("name", new IoMethodFunc(IoMessage.slotName)),
new IoCFunction("setName", new IoMethodFunc(IoMessage.slotSetName)),
new IoCFunction("next", new IoMethodFunc(IoMessage.slotNext)),
new IoCFunction("setNext", new IoMethodFunc(IoMessage.slotSetNext)),
new IoCFunction("code", new IoMethodFunc(IoMessage.slotCode)),
new IoCFunction("arguments", new IoMethodFunc(IoMessage.slotArguments)),
new IoCFunction("appendArg", new IoMethodFunc(IoMessage.slotAppendArg)),
new IoCFunction("argAt", new IoMethodFunc(IoMessage.slotArgAt)),
new IoCFunction("argCount", new IoMethodFunc(IoMessage.slotArgCount)),
new IoCFunction("asString", new IoMethodFunc(IoMessage.slotCode)),
new IoCFunction("cachedResult", new IoMethodFunc(IoMessage.slotCachedResult)),
new IoCFunction("setCachedResult", new IoMethodFunc(IoMessage.slotSetCachedResult)),
new IoCFunction("removeCachedResult", new IoMethodFunc(IoMessage.slotRemoveCachedResult)),
new IoCFunction("hasCachedResult", new IoMethodFunc(IoMessage.slotHasCachedResult)),
};
pro.addTaglessMethodTable(state, methodTable);
return pro;
}
示例13: proto
public override IoObject proto(IoState state)
{
IoList pro = new IoList();
pro.state = state;
// pro.tag.cloneFunc = new IoTagCloneFunc(pro.clone);
pro.createSlots();
pro.createProtos();
pro.list = new IoObjectList();
state.registerProtoWithFunc(pro.name, new IoStateProto(pro.name, pro, new IoStateProtoFunc(pro.proto)));
pro.protos.Add(state.protoWithInitFunc("Object"));
IoCFunction[] methodTable = new IoCFunction[] {
new IoCFunction("indexOf", new IoMethodFunc(IoList.slotIndexOf)),
new IoCFunction("capacity", new IoMethodFunc(IoList.slotSize)),
new IoCFunction("size", new IoMethodFunc(IoList.slotSize)),
new IoCFunction("removeAll", new IoMethodFunc(IoList.slotRemoveAll)),
new IoCFunction("append", new IoMethodFunc(IoList.slotAppend)),
new IoCFunction("appendStr", new IoMethodFunc(IoList.slotAppendStr)),
new IoCFunction("with", new IoMethodFunc(IoList.slotWith)),
new IoCFunction("prepend", new IoMethodFunc(IoList.slotPrepend)),
new IoCFunction("push", new IoMethodFunc(IoList.slotAppend)),
new IoCFunction("at", new IoMethodFunc(IoList.slotAt)),
new IoCFunction("last", new IoMethodFunc(IoList.slotLast)),
new IoCFunction("pop", new IoMethodFunc(IoList.slotPop)),
new IoCFunction("removeAt", new IoMethodFunc(IoList.slotRemoveAt)),
new IoCFunction("reverseForeach", new IoMethodFunc(IoList.slotReverseForeach)),
};
pro.addTaglessMethodTable(state, methodTable);
return pro;
}
示例14: clone
public override IoObject clone(IoState state)
{
IoObject proto = state.protoWithInitFunc(name);
IoList result = new IoList();
uniqueIdCounter++;
result.uniqueId = uniqueIdCounter;
result.list = new IoObjectList();
result.state = state;
result.createProtos();
result.createSlots();
result.protos.Add(proto);
return result;
}
示例15: proto
public override IoObject proto(IoState state)
{
IoNumber pro = new IoNumber();
pro.state = state;
pro.createSlots();
pro.createProtos();
pro.doubleValue = 0;
pro.longValue = 0;
pro.isInteger = true;
state.registerProtoWithFunc(name, new IoStateProto(pro.name, pro, new IoStateProtoFunc(pro.proto)));
pro.protos.Add(state.protoWithInitFunc("Object"));
IoCFunction[] methodTable = new IoCFunction[] {
new IoCFunction("asNumber", new IoMethodFunc(IoNumber.slotAsNumber)),
new IoCFunction("+", new IoMethodFunc(IoNumber.slotAdd)),
new IoCFunction("-", new IoMethodFunc(IoNumber.slotSubstract)),
new IoCFunction("*", new IoMethodFunc(IoNumber.slotMultiply)),
new IoCFunction("/", new IoMethodFunc(IoNumber.slotDivide)),
new IoCFunction("log10", new IoMethodFunc(IoNumber.slotLog10)),
new IoCFunction("log2", new IoMethodFunc(IoNumber.slotLog2)),
new IoCFunction("log", new IoMethodFunc(IoNumber.slotLog)),
new IoCFunction("pow", new IoMethodFunc(IoNumber.slotPow)),
new IoCFunction("pi", new IoMethodFunc(IoNumber.slotPi)),
new IoCFunction("e", new IoMethodFunc(IoNumber.slotE)),
new IoCFunction("minPositive", new IoMethodFunc(IoNumber.slotMinPositive)),
new IoCFunction("exp", new IoMethodFunc(IoNumber.slotExp)),
new IoCFunction("round", new IoMethodFunc(IoNumber.slotRound)),
// new IoCFunction("asString", new IoMethodFunc(this.asString))
};
pro.addTaglessMethodTable(state, methodTable);
return pro;
}