本文整理汇总了C#中SObject.isProcedure方法的典型用法代码示例。如果您正苦于以下问题:C# SObject.isProcedure方法的具体用法?C# SObject.isProcedure怎么用?C# SObject.isProcedure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SObject
的用法示例。
在下文中一共展示了SObject.isProcedure方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: op3_procedure_set
public static SObject op3_procedure_set(SObject arg1, SObject arg2, SObject arg3) {
expect3(arg1.isProcedure(), arg1, arg2.isFixnum(), arg2, true, arg3,
Constants.EX_PROCEDURE_SET);
Procedure p = (Procedure) arg1;
int b = ((SFixnum)arg2).value;
// System.Console.WriteLine("** (procedure-set! {0} {1} {2})", arg1, arg2, arg3);
if (b == 0) {
// "code vector"
p.setCode(arg3);
return Factory.Unspecified;
} else if (b == 1) {
if (arg3.isVector()) {
p.setConstants((SVL)arg3);
return Factory.Unspecified;
} else {
Exn.fault(Constants.EX_PROCEDURE_SET, "not a vector", arg1, arg2, arg3);
return null;
}
} else if (b > 1) {
int bb = b - 2;
if (bb < p.rib.Length) {
p.rib[bb] = arg3;
return Factory.Unspecified;
}
}
Exn.fault(Constants.EX_PROCEDURE_SET, "procedure-set!: bad index " + b, arg1, arg2, arg3);
return null;
}
示例2: op2_procedure_ref
public static SObject op2_procedure_ref(SObject arg1, SObject arg2) {
expect2(arg1.isProcedure(), arg1, arg2.isFixnum(), arg2, Constants.EX_PROCEDURE_REF);
Procedure p = (Procedure) arg1;
int b = ((SFixnum)arg2).value;
if (b == 0) {
// Code vector
return p.getCode();
} else if (b == 1) {
// Constant vector
return p.constantvector;
} else if (b > 1) {
b = b - 2;
if (b < p.rib.Length) {
return p.rib[b];
}
}
Exn.fault(Constants.EX_PROCEDURE_REF, "procedure-ref: bad index", arg1, arg2);
return null;
}
示例3: op2_typetag_set
public static SObject op2_typetag_set(SObject arg1, SObject arg2) {
expect2(arg1.isVectorLike() || arg1.isByteVectorLike() || arg1.isProcedure(), arg1,
arg2.isFixnum(), arg2,
Constants.EX_TYPETAGSET);
if (arg1 is SVL) {
((SVL)arg1).tag = ((SFixnum)arg2).value;
} else if (arg1 is SByteVL) {
((SByteVL)arg1).tag = ((SFixnum)arg2).value;
} else if (arg1 is Procedure) {
((Procedure)arg1).tag = ((SFixnum)arg2).value;
}
return Factory.Unspecified;
}
示例4: op1_procedure_length
/* Procedure operations */
/* -------------------- */
public static SObject op1_procedure_length(SObject arg) {
expect1(arg.isProcedure(), arg, Constants.EX_PROCEDURE_LENGTH);
Procedure p = (Procedure) arg;
// Procedure length is number of rib slots plus 2 (code and constants)
return Factory.wrap(p.rib.Length + 2);
}
示例5: op1_typetag
/* VectorLike and ByteVectorLike operations */
/* ---------------------------------------- */
public static SObject op1_typetag(SObject arg) {
expect1(arg.isVectorLike() || arg.isByteVectorLike() || arg.isProcedure(), arg,
Constants.EX_TYPETAG);
if (arg is SVL) {
return Factory.makeFixnum(((SVL)arg).tag);
} else if (arg is SByteVL) {
return Factory.makeFixnum(((SByteVL)arg).tag);
} else {
return Factory.makeFixnum(((Procedure)arg).tag);
}
}