Permalink
Browse files

Work on new evaluator

Ignore-this: 7b7e3396c929b39f32f94d9ecaef9a65

darcs-hash:20090727015601-228f4-680c21fc8b52b6262bd36d6d732fad9fff765fa1.gz
  • Loading branch information...
1 parent a5a8f8f commit 8d9a89de6e348ac74dd92e93d08c8e818d2977cb eb committed Jul 27, 2009
Showing with 7 additions and 7 deletions.
  1. +7 −7 Ivor/Evaluator.lhs
View
@@ -106,16 +106,16 @@ Code Stack Env Result
> match :: Scheme Name -> [TT Name] -> SEnv -> [(Name, TT Name)] ->
> Maybe (TT Name, [(Name, TT Name)], Stack)
> match (Sch pats rhs) xs env patvars
-> = matchargs pats xs rhs env patvars
-> matchargs [] xs (Ind rhs) env patvars = Just (rhs, patvars, xs)
-> matchargs (p:ps) (x:xs) rhs env patvars
-> = case matchPat p (eval x [] env patvars) patvars of
-> Just patvars' -> matchargs ps xs rhs env patvars'
+> = matchargs pats xs rhs env patvars []
+> matchargs [] xs (Ind rhs) env patvars pv' = Just (rhs, pv', xs)
+> matchargs (p:ps) (x:xs) rhs env patvars pv'
+> = case matchPat p (eval x [] env patvars) pv' of
+> Just patvars' -> matchargs ps xs rhs env patvars patvars'
> Nothing -> Nothing
-> matchargs _ _ _ _ _ = Nothing
+> matchargs _ _ _ _ _ _ = Nothing
> matchPat PTerm x patvars = Just patvars
-> matchPat (PVar n) x patvars = Just ((n,x):patvars)
+> matchPat (PVar n) x patvars = Just ((n,x):patvars) -- (filter (\ (x,y) -> x/=n) patvars))
> matchPat (PConst t) (Const t') patvars
> = do tc <- cast t
> if (tc == t') then Just patvars

0 comments on commit 8d9a89d

Please sign in to comment.