On this page:
4.1 Pairs and Lists
cons/ p
list/ p
listof/ p
4.2 Derived Types
dict/ p

4 List Packings

    4.1 Pairs and Lists

    4.2 Derived Types

 (require (planet "list.ss" ("murphy" "packed-io.plt" 1 0)))
This module provides packings of value lists and other data structures.

4.1 Pairs and Lists

(cons/p car-packing cdr-packing)  packing?
  car-packing : packing?
  cdr-packing : packing?
Produces a packing for pair values that stores the car and cdr fields in sequence using the packings car-packing and cdr-packing.

(list/p packing ...)  packing?
  packing : packing?

Produces a packing for lists of fixed size that stores the elements of the list in sequence using the given packings.

(listof/p packing)  packing?
  packing : packing?
Produces a packing for a homogeneous list of unlimited size that stores the elements in sequence using the given packing.

Combine this with with-size/p to pack a list together with length information.

4.2 Derived Types

(dict/p key-packing value-packing)  packing?
  key-packing : packing?
  value-packing : packing?
Produces a packing for a homogeneous dictionary of unlimited size that stores the key value pairs in sequence using the packings key-packing and value-packing.

When packing, any value satisfying dict? can be used, when unpacking the resulting value is an immutable hash table.

Combine this with with-size/p to pack a dictionary together with length information.