Changeset 12503 for src/Pugs/Prim/Match.hs
- Timestamp:
- 08/20/06 06:48:22 (2 years ago)
- Files:
-
- 1 modified
-
src/Pugs/Prim/Match.hs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Prim/Match.hs
r12324 r12503 105 105 op2Match :: Val -> Val -> Eval Val 106 106 107 op2Match _y@(VCode _) = do107 op2Match x y@(VCode _) = do 108 108 (arity :: Int) <- fromVal =<< op1CodeArity y 109 109 res <- fromVal =<< case arity of 110 0 -> evalExp $ App (Val y) Nothing [] 110 0 -> do 111 writeVar (cast "$*_") x 112 evalExp $ App (Val y) Nothing [] 111 113 1 -> do 112 topic <- readVar (cast "$_") 113 evalExp $ App (Val y) Nothing [Val topic] 114 evalExp $ App (Val y) Nothing [Val x] 114 115 _ -> fail ("Unexpected arity in smart match: " ++ (show arity)) 115 116 return $ VBool $ res
