Examples of StorageSpec


Examples of org.perl6.nqp.sixmodel.StorageSpec

    }
    public static String unbox_s(SixModelObject obj, ThreadContext tc) {
        return decont(obj, tc).get_str(tc);
    }
    public static long isint(SixModelObject obj, ThreadContext tc) {
        StorageSpec ss = decont(obj, tc).st.REPR.get_storage_spec(tc, obj.st);
        return (ss.can_box & StorageSpec.CAN_BOX_INT) == 0 ? 0 : 1;
    }
View Full Code Here

Examples of org.perl6.nqp.sixmodel.StorageSpec

    public static long isint(SixModelObject obj, ThreadContext tc) {
        StorageSpec ss = decont(obj, tc).st.REPR.get_storage_spec(tc, obj.st);
        return (ss.can_box & StorageSpec.CAN_BOX_INT) == 0 ? 0 : 1;
    }
    public static long isnum(SixModelObject obj, ThreadContext tc) {
        StorageSpec ss = decont(obj, tc).st.REPR.get_storage_spec(tc, obj.st);
        return (ss.can_box & StorageSpec.CAN_BOX_NUM) == 0 ? 0 : 1;
    }
View Full Code Here

Examples of org.perl6.nqp.sixmodel.StorageSpec

    public static long isnum(SixModelObject obj, ThreadContext tc) {
        StorageSpec ss = decont(obj, tc).st.REPR.get_storage_spec(tc, obj.st);
        return (ss.can_box & StorageSpec.CAN_BOX_NUM) == 0 ? 0 : 1;
    }
    public static long isstr(SixModelObject obj, ThreadContext tc) {
        StorageSpec ss = decont(obj, tc).st.REPR.get_storage_spec(tc, obj.st);
        return (ss.can_box & StorageSpec.CAN_BOX_STR) == 0 ? 0 : 1;
    }
View Full Code Here

Examples of org.perl6.nqp.sixmodel.StorageSpec

    /* Smart coercions. */
    public static String smart_stringify(SixModelObject obj, ThreadContext tc) {
        obj = decont(obj, tc);

        // If it can unbox to a string, that wins right off.
        StorageSpec ss = obj.st.REPR.get_storage_spec(tc, obj.st);
        if ((ss.can_box & StorageSpec.CAN_BOX_STR) != 0 && !(obj instanceof TypeObject))
            return obj.get_str(tc);

        // If it has a Str method, that wins.
        // We could put this in the generated code, but it's here to avoid the
View Full Code Here

Examples of org.perl6.nqp.sixmodel.StorageSpec

    }
    public static double smart_numify(SixModelObject obj, ThreadContext tc) {
        obj = decont(obj, tc);

        // If it can unbox as an int or a num, that wins right off.
        StorageSpec ss = obj.st.REPR.get_storage_spec(tc, obj.st);
        if ((ss.can_box & StorageSpec.CAN_BOX_INT) != 0)
            return (double)obj.get_int(tc);
        if ((ss.can_box & StorageSpec.CAN_BOX_NUM) != 0)
            return obj.get_num(tc);
View Full Code Here

Examples of org.perl6.nqp.sixmodel.StorageSpec

        final int numElems = (int) arr.elems(tc);
        Object[] args = new Object[numElems];

        for (int i = 0; i < numElems; i++) {
            SixModelObject obj = arr.at_pos_boxed(tc, i);
            StorageSpec ss = obj.st.REPR.get_storage_spec(tc, obj.st);
            if ((ss.can_box & StorageSpec.CAN_BOX_INT) != 0) {
                args[i] = Long.valueOf(obj.get_int(tc));
            } else if ((ss.can_box & StorageSpec.CAN_BOX_NUM) != 0) {
                args[i] = Double.valueOf(obj.get_num(tc));
            } else if ((ss.can_box & StorageSpec.CAN_BOX_STR) != 0) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.