[plt-scheme] evaluating buffer w/o re-initializing environment?
> I'm fine with Matthias's explanation above and at [1]. Sometimes
> though, I wish I could hold on to, say, a database connection.
This sounds appealing, but -- I'm just conjecturing here -- it might
turn out to be more trouble than it's worth. For example, if a database
connection is represented as an instance of a struct, then re-running
the program will generate a new, incompatible struct type. So even if
you have persistent state stored in "cookies" somewhere, you won't
actually be able to *use* your database connection.
Even if you use some kind of more transparent data structure, the data
might be tied to some stateful code somewhere, possibly buried deep in
some transitively required library, and the new instance of the program
that has generated fresh state is probably not expecting to interact
with leftover data from a previous instance of the program.
I suspect this is the kind of stuff that Matthias is talking about as
causing extra unnecessary complexity that distracts even genius Lisp
hackers.
Dave