[don't lambda-lift errors in lazy context, handle them in the grin generator directly
John Meacham <john@repetae.net>**20051013112310] hunk ./E/LambdaLift.hs 205
-shouldLift EError {} = True
+--shouldLift EError {} = True
hunk ./Grin/FromE.hs 35
-import Stats
+import qualified Stats
+import Stats(mtick)
hunk ./Grin/FromE.hs 38
+import Util.Once
hunk ./Grin/FromE.hs 67
+    errorOnce :: OnceMap (Ty,String) Atom,
hunk ./Grin/FromE.hs 110
-compile dataTable nmap sc@SC { scMain = mt, scCombinators = cm } = do
+compile dataTable _ sc@SC { scMain = mt, scCombinators = cm } = do
hunk ./Grin/FromE.hs 121
+    errorOnce <- newOnceMap
hunk ./Grin/FromE.hs 128
+            errorOnce = errorOnce,
hunk ./Grin/FromE.hs 133
+
+    wdump FD.Progress $ do
+        os <- onceMapToList errorOnce
+        mapM_ print os
hunk ./Grin/FromE.hs 450
-        let t = toAtom $ "Bap_" ++ show (length as) ++ "_" ++ funcName ++ "_" ++ show vn
+        let t  = toAtom $ "Bap_" ++ show (length as) ++ "_" ++ funcName ++ "_" ++ show vn
hunk ./Grin/FromE.hs 463
-    cc e | Just z <- con e = do
-        return (Store z)
+    cc e | Just z <- con e = return (Store z)
+    cc (EError s e) = do
+        let ty = toType TyNode e
+        a <- runOnceMap (errorOnce cenv) (ty,s) $ do
+            u <- newUniq
+            let t  = toAtom $ "Berr_" ++ show u
+                tl = toAtom $ "berr_" ++ show u
+            addNewFunction (tl,Tup [] :-> Error s ty)
+            return t
+        return $ Return (Const (NodeC a []))
hunk ./Main.hs 380
-    wdump FD.Grin $ printGrin x
+    --wdump FD.Grin $ printGrin x
hunk ./docs/todo.otl 14
+		suspended errors should be constants, since they are never updated