本文整理汇总了C#中Variable.Store方法的典型用法代码示例。如果您正苦于以下问题:C# Variable.Store方法的具体用法?C# Variable.Store怎么用?C# Variable.Store使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Variable
的用法示例。
在下文中一共展示了Variable.Store方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AssignV
public static void AssignV(Variable lhs, IP6 rhs)
{
if (!lhs.islist) {
lhs.Store(rhs);
} else {
Frame n = lhs.Fetch().InvokeMethod(Kernel.GetInferiorRoot(),
"LISTSTORE",
new Variable[2] { lhs, Kernel.NewROScalar(rhs) }, null);
Kernel.RunInferior(n);
}
}
示例2: AssignV
// Assign a value to a variable, while handling list variables sensibly
public static void AssignV(Variable lhs, P6any rhs)
{
if (!lhs.islist) {
lhs.Store(rhs);
} else {
lhs.Fetch().mo.mro_LISTSTORE.Get(lhs, Kernel.NewROScalar(rhs));
}
}
示例3: mixin
public static Variable mixin(Constants c, P6any obj, Variable role_list, Variable init,
Variable newtype)
{
VarDeque iter = start_iter(role_list);
List<STable> roles = new List<STable>();
while (Kernel.IterHasFlat(iter, true))
roles.Add(iter.Shift().Fetch().mo);
STable n = new STable(c.setting, obj.mo.name + "+" + Kernel.JoinS(",", roles));
n.how = Kernel.BoxAny<STable>(n, obj.mo.how).Fetch();
n.typeObj = n.initObj = new P6opaque(n);
((P6opaque)n.typeObj).slots = null;
n.mo.superclasses.Add(obj.mo);
n.mo.local_roles = roles;
n.mo.Compose();
newtype.Store(n.typeObj);
string aname = null;
if (init != c.setting.AnyP) {
if (!obj.IsDefined())
throw new NieczaException("Cannot initialize a slot when mixing into a type object");
if (n.mo.local_attr.Count != 1 || (n.mo.local_attr[0].flags & P6how.A_PUBLIC) == 0)
throw new NieczaException("Role(s) being mixed in do not define precisely one, public attribute");
aname = n.mo.local_attr[0].name;
}
if (obj.IsDefined()) {
obj.ChangeType(n);
BuildMostDerived(obj);
if (aname != null)
Kernel.Assign((Variable)obj.GetSlot(n, aname), init);
return obj;
} else {
return n.typeObj;
}
}