Changeset 9988

Show
Ignore:
Timestamp:
04/17/06 19:47:37 (3 years ago)
Author:
yiyihu
Message:

s/&\?SUB/&\?ROUTINE/g in Prim.hs and Monads.hs, So that &?ROUTINE()
works.
And initial import for misc/S29_round.pl. :-)

Files:
1 added
2 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Monads.hs

    r9480 r9988  
    271271        | otherwise = do 
    272272            subRec <- sequence 
    273                 [ genSym "&?SUB" (codeRef (orig sub)) 
     273                [ genSym "&?ROUTINE" (codeRef (orig sub)) 
    274274                , genSym "$?SUBNAME" (scalarRef $ VStr $ subName sub)] 
    275275            -- retRec    <- genSubs env "&return" retSub 
     
    280280                , envOuter   = maybe Nothing envOuter (subEnv sub) 
    281281                , envImplicit= envImplicit e `Map.union` Map.fromList 
    282                     [ ("&?SUB", ()), ("$?SUBNAME", ()), ("&?CALLER_CONTINUATION", ()) ] 
     282                    [ ("&?ROUTINE", ()), ("$?SUBNAME", ()), ("&?CALLER_CONTINUATION", ()) ] 
    283283                } 
    284284    ccSub :: (Val -> Eval Val) -> Env -> VCode 
  • src/Pugs/Prim.hs

    r9929 r9988  
    686686    depth <- asks envDepth 
    687687    if depth == 0 then fail "cannot return() outside a subroutine" else do 
    688     sub   <- fromVal =<< readVar "&?SUB" 
     688    sub   <- fromVal =<< readVar "&?ROUTINE" 
    689689    -- If this is a coroutine, reset the entry point 
    690690    case subCont sub of 
     
    702702    depth <- asks envDepth 
    703703    if depth == 0 then fail "cannot yield() outside a coroutine" else do 
    704     sub   <- fromVal =<< readVar "&?SUB" 
     704    sub   <- fromVal =<< readVar "&?ROUTINE" 
    705705    case subCont sub of 
    706706        Nothing -> fail $ "cannot yield() from a " ++ pretty (subType sub) 
     
    13471347        case envCaller cur of 
    13481348            Just caller -> do 
    1349                 val <- local (const caller) (readVar "&?SUB") 
     1349                val <- local (const caller) (readVar "&?ROUTINE") 
    13501350                if (val == undef) then return [(caller, Nothing)] else do 
    13511351                sub <- fromVal val