Sample Generator

Meaning

A sample generator is implied in each actual declarer in variable declarations. For example, in the variable declaration int foo there is a sample generator for an integral value, that generates the name ascribed to foo. The sample generator becomes explicit in the equivalent identity declaration ref int foo = loc int and also in variable declarations like loc int foo and heap int bar.

If an actual declarer features bounds in contracted variable declarations, the units conforming the bounds are elaborated just once and then used in all the sample generators. So for example, in the contracted declaration [i +:= 1]int foo, bar, baz, all three multiples will have length i + 1.

Usage

A practical distinction between sample generators and “regular” generators is that often an implementation will optimize the first so they don’t require indirection, and can potentially lead to more efficient and/or smaller compiled code. This is the case of GCC for example.

See Also