本文整理汇总了C#中SObject.isByteVectorLike方法的典型用法代码示例。如果您正苦于以下问题:C# SObject.isByteVectorLike方法的具体用法?C# SObject.isByteVectorLike怎么用?C# SObject.isByteVectorLike使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SObject
的用法示例。
在下文中一共展示了SObject.isByteVectorLike方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: op2_sys_bvlcmp
public static SObject op2_sys_bvlcmp(SObject arg1, SObject arg2) {
expect2(arg1.isByteVectorLike(), arg1, arg2.isByteVectorLike(), arg2, -1);
byte[] a = ((SByteVL) arg1).elements;
byte[] b = ((SByteVL) arg2).elements;
int upper = (a.Length < b.Length) ? a.Length : b.Length;
for (int i = 0; i < upper; ++i) {
if (a[i] == b[i]) {
continue;
} else {
return Factory.makeFixnum(a[i] - b[i]);
}
}
return Factory.makeFixnum(a.Length - b.Length);
}
示例2: op3_bytevector_like_set
public static SObject op3_bytevector_like_set(SObject arg1, SObject arg2, SObject arg3) {
expect3(arg1.isByteVectorLike(), arg1, arg2.isFixnum(), arg2, arg3.isFixnum(), arg3,
Constants.EX_BVLSET);
rangeCheckBVL(arg1, arg2, arg3, Constants.EX_BVLSET);
((SByteVL)arg1).elements[((SFixnum)arg2).value] = (byte)((SFixnum)arg3).value;
return Factory.Unspecified;
}
示例3: op2_bytevector_like_ref
public static SObject op2_bytevector_like_ref(SObject arg1, SObject arg2) {
expect2(arg1.isByteVectorLike(), arg1, arg2.isFixnum(), arg2, Constants.EX_BVLREF);
rangeCheckBVL(arg1, arg2, Constants.EX_BVLREF);
return Factory.wrap(((SByteVL)arg1).elements[((SFixnum)arg2).value]);
}
示例4: op1_bytevector_like_length
/* Bytevector-likoe operations */
/* -------------------------- */
public static SObject op1_bytevector_like_length(SObject arg) {
expect1(arg.isByteVectorLike(), arg, Constants.EX_BVLLEN);
return Factory.makeFixnum(((SByteVL)arg).length());
}
示例5: 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;
}
示例6: 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);
}
}