本文整理匯總了C#中io.IoState類的典型用法代碼示例。如果您正苦於以下問題:C# IoState類的具體用法?C# IoState怎麽用?C# IoState使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
IoState類屬於io命名空間,在下文中一共展示了IoState類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: createObject
public static IoString createObject(IoState state, string symbol)
{
IoString str = new IoString();
str = str.clone(state) as IoString;
str.value = symbol;
return str;
}
示例2: 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;
}
示例3: createObject
public static IoSeq createObject(IoState state, string symbol)
{
IoSeq seq = new IoSeq();
seq = seq.clone(state) as IoSeq;
seq.value = symbol;
return seq;
}
示例4: IoCLR
public IoCLR(IoState state, string name)
{
isActivatable = true;
this.state = state;
createSlots();
createProtos();
uniqueId = 0;
}
示例5: IoCFunction
public IoCFunction(IoState state, string name, IoMethodFunc func)
{
isActivatable = true;
this.state = state;
createSlots();
createProtos();
uniqueId = 0;
funcName = name;
this.func = func;
}
示例6: 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;
}
示例7: proto
public override IoObject proto(IoState state)
{
IoCLRAssembly pro = new IoCLRAssembly();
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("namespaces", new IoMethodFunc(IoCLRAssembly.slotNamespaces)),
};
pro.addTaglessMethodTable(state, methodTable);
return pro;
}
示例8: Main
static void Main()
{
IoState state = new IoState();
state.prompt(state);
}
示例9: createProto
public static new IoCLRAssembly createProto(IoState state)
{
IoCLRAssembly cf = new IoCLRAssembly();
return cf.proto(state) as IoCLRAssembly;
}
示例10: createObject
public static new IoCLRAssembly createObject(IoState state)
{
IoCLRAssembly cf = new IoCLRAssembly();
return cf.proto(state).clone(state) as IoCLRAssembly;
}
示例11: IoSeqObjectHashtable
public IoSeqObjectHashtable(IoState s)
{
state = s;
}
示例12: createObject
public static new IoBlock createObject(IoState state)
{
IoBlock number = new IoBlock();
return number.clone(state) as IoBlock;
}
示例13: 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;
}
示例14: 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;
}
示例15: 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;
}