[don't reevaluate variables bound by case evaluation, allow storing of unknown nodes, optimize case transformation
John Meacham <john@repetae.net>**20060404231434] hunk ./C/FromGrin.hs 112
+convertExp (Store n@Var {}) = do
+    (ss,nn) <- newNode (NodeC tagHole [])
+    tmp <- newVar pnode_t
+    n <- convertVal n
+    let tag = project' anyTag n
+        update = expr (functionCall (name "memcpy") [tmp,n,functionCall  (name "jhc_sizeof") [tag]])
+    return (ss `mappend` (tmp `assign` nn) `mappend` update, tmp)
hunk ./Grin/FromE.hs 23
+import Info.Types
hunk ./Grin/FromE.hs 298
+    ce (EVar tvr) | Just CaseDefault <- Info.lookup (tvrInfo tvr)  = do
+        mtick "Grin.FromE.strict-casedefault"
+        return (Fetch (toVal tvr))
+    ce (EVar tvr) | getProperty prop_WHNF tvr = do
+        mtick "Grin.FromE.strict-propevaled"
+        return (Fetch (toVal tvr))
hunk ./Grin/FromE.hs 383
-    ce ECase { eCaseScrutinee = e, eCaseBind = b, eCaseAlts = as, eCaseDefault = d }  = do
+    ce ECase { eCaseScrutinee = scrut, eCaseBind = b, eCaseAlts = as, eCaseDefault = d }  = do
hunk ./Grin/FromE.hs 385
-        e <- ce e
+        e <- ce scrut
hunk ./Grin/FromE.hs 387
-        def <- createDef d (newNodeVar)
-        return $
-            e :>>= v :->
-            Store v :>>= toVal b :->
-            Case v (as ++ def)
+        def <- createDef d newNodeVar
+        return $ case (def,b,scrut) of
+            ([],_,_) -> e :>>= v :-> Case v as
+            (_,TVr {tvrIdent = 0 },_) -> e :>>= v :-> Case v (as ++ def)
+            (_,_,EVar etvr) ->  e :>>= v :-> Return (toVal etvr) :>>= toVal b :-> Case v (as ++ def)
+            (_,_,_) -> e :>>= v :-> Store v :>>= toVal b :-> Case v (as ++ def)
hunk ./Info/Types.hs 68
+prop_WHNF = toAtom "_WHNF"