Make evaluation of lists of bits non-strict in the elements.

This means that e.g. [True, error "foo"]@0 evaluates to True,
similar to how [0x1, error "foo"]@0 evaluates to 0x1.
This commit is contained in:
Brian Huffman 2014-11-12 13:27:49 -08:00
parent 7e099a5236
commit 6368bcbe38

View File

@ -43,7 +43,7 @@ evalExpr env expr = case expr of
ECon con -> evalECon con
EList es ty -> evalList env es (evalType env ty)
EList es ty -> VSeq (isTBit (evalType env ty)) (map (evalExpr env) es)
ETuple es -> VTuple (map eval es)
@ -208,15 +208,3 @@ evalMatch env m = case m of
-- they are typechecked that way; the read environment to evalDecl is the same
-- as the environment to bind a new name in.
Let d -> [evalDecl env d env]
-- Lists -----------------------------------------------------------------------
-- | Evaluate a list literal, optionally packing them into a word.
evalList :: EvalEnv -> [Expr] -> TValue -> Value
evalList env es ty = toPackedSeq w ty (map (evalExpr env) es)
where
w = TValue $ tNum $ length es