First class environments
A first class environment is a set of variable bindings which can be stored in variables, passed to functions, compared, etc.
The task is to build a dozen environments, and a single piece of code to be run repeatedly in each of these envionments.
Each environment contains the bindings for two variables: A value in the Hailstone sequence, and a count which is incremented until the value drops to 1. The initial hailstone values are 1 through 12, and the count in each environment is zero.
When the code runs, it calculates the next hailstone step in the current environment (unless the value is already 1) and counts the steps. Then it prints the current value in a tabular form.
When all hailstone values dropped to 1, processing stops, and the total number of hailstone steps for each environment is printed.