(Sorry for the three messages in a row.)

  BTW, the way I have this working now is to evaluate all initializers 
first, check for errors, if there are no errors add them all to the
environment, then use an update function which

        update :: Env -> Datum -> Datum

  which is the identity on all datums except for closures to replace
the old environment in a closure with the new one (with all the
bindings in it).  I map the update function over the list of all
initializer values to update all the closures with the correct
environment, and then just "re-add" all the values to the
environment.  Finally, I use that last environment to run the letrec
body in.  In short,

        1. eval all initializers
        2. check for errors
        3. bind initializer values, producing env'
        4. map update over all initializer values vals, producing vals'
        5. bind vals' in env', producing env''
        6. eval the body in env''

  So I guess I answered my own question, but if there is a more
elegant way to do this, I would appreciate suggestions.

Frank Christoph
[EMAIL PROTECTED]


Reply via email to