本文整理汇总了C#中SObject.isFixnum方法的典型用法代码示例。如果您正苦于以下问题:C# SObject.isFixnum方法的具体用法?C# SObject.isFixnum怎么用?C# SObject.isFixnum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SObject
的用法示例。
在下文中一共展示了SObject.isFixnum方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: op1_enable_interrupts
/* Misc */
/* ---- */
public static void op1_enable_interrupts(SObject arg) {
Ops.expect1(arg.isFixnum(), arg, Constants.EX_EINTR);
int time = ((SFixnum)arg).value;
if (time > 0) {
Reg.interruptsEnabled = true;
Reg.timer = time;
} else {
Exn.fault(Constants.EX_EINTR,
"enable-interrupts: expected positive value");
}
Reg.Result = Factory.Unspecified;
Exn.checkSignals();
}
示例2: op2_bytevector_fill
public static SObject op2_bytevector_fill(SObject arg1, SObject arg2) {
expect2(arg1.isByteVector(), arg1, arg2.isFixnum(), arg2, Constants.EX_BVFILL);
((SByteVL)arg1).fill((byte)((SFixnum)arg2).value);
return Factory.Unspecified;
}
示例3: op1_make_bytevector
/* Bytevector operations */
/* --------------------- */
public static SObject op1_make_bytevector(SObject arg) {
expect1(arg.isFixnum(), arg, Constants.EX_MKBVL);
return Factory.makeByteVector(((SFixnum)arg).intValue(), (byte)0);
}
示例4: op1_integer2char
public static SObject op1_integer2char(SObject arg) {
expect1(arg.isFixnum(), arg, Constants.EX_INT2CHAR);
return Factory.makeChar(((SFixnum)arg).value);
}
示例5: op2_rsha
public static SObject op2_rsha(SObject arg1, SObject arg2) {
expect2(arg1.isFixnum(), arg1, arg2.isFixnum(), arg2, Constants.EX_RSHA);
int a = ((SFixnum)arg1).value;
int b = ((SFixnum)arg2).value;
return Factory.makeFixnum(a >> b);
}
示例6: op1_lognot
/* Logical (aka Bitwise) Ops */
/* ------------------------- */
/* Logical operations operate on fixnums
* What about bignums? See SRFI... ?
*/
public static SObject op1_lognot(SObject arg) {
expect1(arg.isFixnum(), arg, Constants.EX_LOGNOT);
int a = ((SFixnum)arg).value;
return Factory.makeFixnum(~a);
}
示例7: op2_fxmul
public static SObject op2_fxmul(SObject arg1, SObject arg2) {
expect2(arg1.isFixnum(), arg1, arg2.isFixnum(), arg2, Constants.EX_FXMUL);
int a = ((SFixnum)arg1).value;
int b = ((SFixnum)arg2).value;
int c = a * b;
if (!SFixnum.inFixnumRange(c)) {
Exn.fault(Constants.EX_FXMUL, "result not a fixnum", arg1, arg2);
}
return Factory.makeNumber(c);
}
示例8: op1_fxnegativep
public static SObject op1_fxnegativep(SObject arg) {
expect1(arg.isFixnum(), arg, Constants.EX_FXNEGATIVE);
int a = ((SFixnum)arg).value;
return Factory.makeBoolean(a < 0);
}
示例9: 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;
}
示例10: op1_make_procedure
public static SObject op1_make_procedure(SObject arg) {
expect1(arg.isFixnum(), arg, Constants.EX_MKVL);
int a = ((SFixnum)arg).value - 2;
SObject[] env = new SObject[a];
env[0] = Factory.False;
for (int i = 1; i < a; ++i) {
env[i] = Factory.Null; // So says Petit Larceny
}
return new Procedure(CodeVector.NoCode,
Factory.makeVector(0, Factory.False),
env);
}
示例11: op2_sys_partial_list__vector
public static SObject op2_sys_partial_list__vector(SObject arg1, SObject arg2) {
expect2(arg1 == Factory.Null || arg1 is SPair, arg1, arg2.isFixnum(), arg2, -1);
int n = ((SFixnum)arg2).value;
SObject[] items = new SObject[n];
for (int i = 0; i < n; ++i) {
items[i] = ((SPair)arg1).first;
arg1 = ((SPair)arg1).rest;
}
return Factory.makeVector(items);
}
示例12: op3_vector_set
public static SObject op3_vector_set(SObject arg1, SObject arg2, SObject arg3) {
expect3(arg1.isVector(), arg1, arg2.isFixnum(), arg2, true, arg3, Constants.EX_VECTOR_SET);
rangeCheckVL(arg1, arg2, arg3, Constants.EX_VLSET);
((SVL)arg1).elements[((SFixnum)arg2).value] = arg3;
return Factory.Unspecified;
}
示例13: op2_vector_ref
public static SObject op2_vector_ref(SObject arg1, SObject arg2) {
expect2(arg1.isVector(), arg1, arg2.isFixnum(), arg2, Constants.EX_VECTOR_REF);
rangeCheckVL(arg1, arg2, Constants.EX_VLREF);
return ((SVL)arg1).elements[((SFixnum)arg2).value];
}
示例14: op2_make_vector
/* Vector operations */
/* ----------------- */
public static SObject op2_make_vector(SObject arg1, SObject arg2) {
expect2(arg1.isFixnum(), arg1, true, arg2, Constants.EX_MKVL);
return Factory.makeVector(((SFixnum)arg1).value, arg2);
}
示例15: 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;
}