Clifford Beshers wrote:
> All right, I'll take the bait.
> 
> The most important thing is to realize that we are discussing
> computations that need to be done at compile time.  The results affect
> the body of the source code.  Right now, the source code is
> effectively required to be constant.  If we think in good functional
> programming terms, we want to have the source code be the result of
> some function.

How about an `eval' Function?
> eval :: String -> a
It takes a chunk of Haskell code and evaluates it. Seen it done in Lisp
many times.

It may not be the most efficient function in the world. Perhaps you
could use some sort of special syntax to notify the compiler that a
particular string will be used in an `eval' application. It can then try
to thunk as much of it as it can prior to run-time. Perhaps all of it,
depending on what's defined in the hypothetical SystemState module.

Or were you thinking of something even more elegant? (I must admit that
I haven't looked at MetaML yet.)

- Michael Hobbs



Reply via email to