## 7.12.10 Let constructs and patterns

Page 240 of 800 |
| Search internet |

The value of

is where is . In other words, the value of the term above is .

The value of

is the value of where is and is . We have

so the value of

is the value of where is and is . In this case, the let-construct provides an easy way to destructure the pair returned by the floor function.

The value of

is the value of where is . The assignment of a value to the constant is ignored.

The value of

is the value of where , , , , and are the reference, index, debugging information, first subtree, and second subtree, respectively, of . Before macro expansion of the let construct itself, the pattern

is macro expanded to

The value of

is the value of where both and are .

The destructuring properties of the pair construct is defined as a list with two elements, one for each of the two arguments of the pair. The first element of the list reads

When a pair is destructured, the pair is inserted in place of the asterisk. The second element of the list reads

The base page essentially defines the destructuring properties of pairs thus:

The definition on the base page looks a bit more clumsy, but that is because the definition must work before e.g. tuples are in place.

The base page only defines destructuring properties for pairs. Authors are free to define arbitrary destructuring properties for their constructs.

Page 240 of 800 |
| Search logiweb.eu |

Copyright © 2010
Klaus Grue,
GRD-2010-01-05