Implementierung der statischen Bindung

data Object = .. | OFunction { args :: [ Name ]
    , body :: Expression , env  :: Env Object }
eval env exp = case exp of ...
    Lambda { args = a, body = b } -> return $ 
      OFunction { args = a,body = b,env = env }
    Apply f xs -> do
        ff <- eval env f
        vs <- mapM ( eval env ) xs
        let env' = Env.new ( Object.env ff )
                 $ zip ( Object.args ff ) vs
        eval env' ( Object.body ff )



2009-11-20