本文整理汇总了C#中Ioke.Lang.IokeObject.FindCell方法的典型用法代码示例。如果您正苦于以下问题:C# IokeObject.FindCell方法的具体用法?C# IokeObject.FindCell怎么用?C# IokeObject.FindCell使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ioke.Lang.IokeObject
的用法示例。
在下文中一共展示了IokeObject.FindCell方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Activate
public virtual object Activate(IokeObject self, IokeObject context, IokeObject message, object on)
{
object cell = self.FindCell(message, context, "activate");
if(cell == context.runtime.nul) {
report(self, context, message, "activate");
return context.runtime.nil;
} else {
IokeObject newMessage = Message.DeepCopy(message);
newMessage.Arguments.Clear();
newMessage.Arguments.Add(context.runtime.CreateMessage(Message.Wrap(context)));
newMessage.Arguments.Add(context.runtime.CreateMessage(Message.Wrap(message)));
newMessage.Arguments.Add(context.runtime.CreateMessage(Message.Wrap(IokeObject.As(on, context))));
return IokeObject.GetOrActivate(cell, context, newMessage, self);
}
}
示例2: GetOpTable
private static IDictionary GetOpTable(IokeParser parser, IokeObject opTable, string name, OpTableCreator creator)
{
IokeObject operators = IokeObject.As(opTable.FindCell(parser.message, parser.context, name), null);
if(operators != parser.runtime.nul && (IokeObject.dataOf(operators) is Dict)) {
return Dict.GetMap(operators);
} else {
IDictionary result = creator.Create(parser.runtime);
opTable.SetCell(name, parser.runtime.NewDict(result));
return result;
}
}
示例3: GetOpTable
public IDictionary GetOpTable(IokeObject opTable, string name, OpTableCreator creator)
{
IokeObject operators = IokeObject.As(opTable.FindCell(_message, _context, name), null);
if(operators != runtime.nul && (IokeObject.dataOf(operators) is Dict)) {
return Dict.GetMap(operators);
} else {
var result = creator.Create(runtime);
opTable.SetCell(name, runtime.NewDict(result));
return result;
}
}
示例4: ToString
public virtual string ToString(IokeObject self)
{
object obj = self.FindCell(null, null, "kind");
int h = HashCode(self);
string hash = System.Convert.ToString(h, 16).ToUpper();
if(obj is NullObject) {
return "#<nul:" + hash + ">";
}
string kind = ((Text)IokeObject.dataOf(obj)).GetText();
return "#<" + kind + ":" + hash + ">";
}
示例5: Levels
public Levels(IokeObject msg, IokeObject context, IokeObject message)
{
this.runtime = context.runtime;
this._context = context;
this._message = message;
IokeObject opTable = IokeObject.As(msg.FindCell(_message, _context, "OperatorTable"), null);
if(opTable == runtime.nul) {
opTable = runtime.NewFromOrigin();
opTable.Kind = "Message OperatorTable";
runtime.Message.SetCell("OperatorTable", opTable);
opTable.SetCell("precedenceLevelCount", runtime.NewNumber(OP_LEVEL_MAX));
}
this.operatorTable = GetOpTable(opTable, "operators", new BinaryOpTableCreator());
this.trinaryOperatorTable = GetOpTable(opTable, "trinaryOperators", new TrinaryOpTableCreator());
this.invertedOperatorTable = GetOpTable(opTable, "invertedOperators", new InvertedOpTableCreator());
this.stack = new SaneList<Level>();
this.Reset();
}