Changeset 9988
- Timestamp:
- 04/17/06 19:47:37 (3 years ago)
- Files:
-
- 1 added
- 2 modified
-
misc/S29_round.pl (added)
-
src/Pugs/Monads.hs (modified) (2 diffs)
-
src/Pugs/Prim.hs (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Monads.hs
r9480 r9988 271 271 | otherwise = do 272 272 subRec <- sequence 273 [ genSym "&? SUB" (codeRef (orig sub))273 [ genSym "&?ROUTINE" (codeRef (orig sub)) 274 274 , genSym "$?SUBNAME" (scalarRef $ VStr $ subName sub)] 275 275 -- retRec <- genSubs env "&return" retSub … … 280 280 , envOuter = maybe Nothing envOuter (subEnv sub) 281 281 , envImplicit= envImplicit e `Map.union` Map.fromList 282 [ ("&? SUB", ()), ("$?SUBNAME", ()), ("&?CALLER_CONTINUATION", ()) ]282 [ ("&?ROUTINE", ()), ("$?SUBNAME", ()), ("&?CALLER_CONTINUATION", ()) ] 283 283 } 284 284 ccSub :: (Val -> Eval Val) -> Env -> VCode -
src/Pugs/Prim.hs
r9929 r9988 686 686 depth <- asks envDepth 687 687 if depth == 0 then fail "cannot return() outside a subroutine" else do 688 sub <- fromVal =<< readVar "&? SUB"688 sub <- fromVal =<< readVar "&?ROUTINE" 689 689 -- If this is a coroutine, reset the entry point 690 690 case subCont sub of … … 702 702 depth <- asks envDepth 703 703 if depth == 0 then fail "cannot yield() outside a coroutine" else do 704 sub <- fromVal =<< readVar "&? SUB"704 sub <- fromVal =<< readVar "&?ROUTINE" 705 705 case subCont sub of 706 706 Nothing -> fail $ "cannot yield() from a " ++ pretty (subType sub) … … 1347 1347 case envCaller cur of 1348 1348 Just caller -> do 1349 val <- local (const caller) (readVar "&? SUB")1349 val <- local (const caller) (readVar "&?ROUTINE") 1350 1350 if (val == undef) then return [(caller, Nothing)] else do 1351 1351 sub <- fromVal val
