当前位置: 首页>>代码示例>>C#>>正文


C# SObject.isByteVectorLike方法代码示例

本文整理汇总了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);
    }
开发者ID:justinethier,项目名称:larceny,代码行数:15,代码来源:ClassicOps.cs

示例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;
 }
开发者ID:justinethier,项目名称:larceny,代码行数:7,代码来源:ClassicOps.cs

示例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]);
 }
开发者ID:justinethier,项目名称:larceny,代码行数:5,代码来源:ClassicOps.cs

示例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());
    }
开发者ID:justinethier,项目名称:larceny,代码行数:7,代码来源:ClassicOps.cs

示例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;
 }
开发者ID:justinethier,项目名称:larceny,代码行数:13,代码来源:ClassicOps.cs

示例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);
        }
    }
开发者ID:justinethier,项目名称:larceny,代码行数:14,代码来源:ClassicOps.cs


注:本文中的SObject.isByteVectorLike方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。