Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

The Basic Syntax

A binary comprehension has two primary forms, distinguished by what they produce:

Form 1: Producing Lists from Binaries

(list-comp (<qual> ...) (<binary-generator> ...) [<guard> ...])

This generates a list by iterating over binary data. The syntax (<= binary-pattern source-binary) creates a binary generator.

Form 2: Producing Binaries

(binary-comp (<binary-qual> ...) (<binary-generator> ...) [<guard> ...])

This generates a binary by iterating over binary (or list) data. The binary qualifier must be wrapped in << >> (conceptually speaking—LFE uses the binary form).