#lang scribble/doc @(require scribble/manual (for-label "../packing.rkt" "../list.rkt")) @title[#:tag "list"]{List Packings} @local-table-of-contents[] @defmodule[(planet "list.rkt" ("murphy" "packed-io.plt" 1 1))]{ This module provides packings of value lists and other data structures. } @section{Pairs and Lists} @defproc[(cons/p [car-packing packing?] [cdr-packing packing?]) packing?]{ Produces a packing for pair values that stores the @racket[car] and @racket[cdr] fields in sequence using the packings @racket[car-packing] and @racket[cdr-packing]. } @defproc[(list/p [packing packing?] ...) packing?]{ Produces a packing for lists of fixed size that stores the elements of the list in sequence using the given packings. } @defproc[(listof/p [packing packing?]) packing?]{ Produces a packing for a homogeneous list of unlimited size that stores the elements in sequence using the given @racket[packing]. Combine this with @racket[with-size/p] to pack a list together with length information. } @section[#:tag "list-derived"]{Derived Types} @defproc[(dict/p [key-packing packing?] [value-packing packing?]) packing?]{ Produces a packing for a homogeneous dictionary of unlimited size that stores the key value pairs in sequence using the packings @racket[key-packing] and @racket[value-packing]. When packing, any value satisfying @racket[dict?] can be used, when unpacking the resulting value is an immutable hash table. Combine this with @racket[with-size/p] to pack a dictionary together with length information. }