PreviousUpNext

15.3.562  src/lib/std/src/unsafe/unsafe-chunk.api

## unsafe-chunk.api

# Compiled by:
#     src/lib/std/src/standard-core.sublib



api Unsafe_Chunk {

    Chunk;

    # Information about the memory representation of a chunk.
    # NOTE: some of these are not supported yet, but will be once the new
    # rw_vector representation is available.

    Representation
        = UNBOXED
        | UNT1
        | FLOAT64
        | PAIR
        | RECORD
        | REF
        | TYPEAGNOSTIC_RO_VECTOR
        | TYPEAGNOSTIC_RW_VECTOR        # includes REF 
        | BYTE_RO_VECTOR                # includes vector_of_one_byte_unts::Vector and vector_of_chars::Vector 
        | BYTE_RW_VECTOR                # includes rw_vector_of_one_byte_unts::rw_vector and rw_vector_of_chars::rw_vector 
#       | FLOAT64_RO_VECTOR             # use TYPEAGNOSTIC_RO_VECTOR for now    XXX BUGGO FIXME
        | FLOAT64_RW_VECTOR
        | LAZY_SUSPENSION
        | WEAK_POINTER
        ;

    to_chunk:  X -> Chunk;

    make_tuple:  List(Chunk) -> Chunk;

    boxed:    Chunk -> Bool;
    unboxed:  Chunk -> Bool;
    rep:      Chunk -> Representation;

    length:   Chunk -> Int;
        # Returns length part of descriptor (untagged pairs return 2).
        # Raises Representation on unboxed values.


    exception REPRESENTATION;

    to_tuple:              Chunk -> List( Chunk );
    to_string:             Chunk -> String;
    to_ref:                Chunk -> Ref( Chunk );
    to_rw_vector:          Chunk -> Rw_Vector( Chunk );
    to_float64_rw_vector:  Chunk -> rw_vector_of_eight_byte_floats::Rw_Vector;
    to_byte_rw_vector:     Chunk -> rw_vector_of_one_byte_unts::Rw_Vector;
    to_vector:             Chunk -> Vector( Chunk );
    to_byte_vector:        Chunk -> vector_of_one_byte_unts::Vector;
    to_exn:                Chunk -> Exception;
    to_float:              Chunk -> Float;
    to_int:                Chunk -> Int;
    to_int1:              Chunk -> one_word_int::Int;
    to_unt:                Chunk -> unt::Unt;
    to_unt8:               Chunk -> one_byte_unt::Unt;
    to_unt1:               Chunk -> one_word_unt::Unt;

    # Fetch nth element of tuple 
    nth:          ((Chunk, Int)) -> Chunk;

};




## COPYRIGHT (c) 1997 Bell Labs, Lucent Technologies.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext