Changeset 14275 for src/Pugs/Eval.hs

Show
Ignore:
Timestamp:
10/12/06 02:11:27 (2 years ago)
Author:
audreyt
Message:

* Make the Pugs shell use the shiny new ControlContinuation?.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Eval.hs

    r14210 r14275  
    148148            trapVal val (return val) 
    149149        Nothing -> do 
    150             val <- local (\e -> e{ envBody = exp }) (reduce exp) 
     150            val <- reduce exp 
    151151            trapVal val (return val) 
    152152 
     
    309309            _  -> enterContext cxtVoid 
    310310    val <- withCxt (reduce this) 
    311     let writeEnv = do 
     311    trapVal val $ case rest of 
     312        Syn "continuation" []   -> callCC $ \cc -> do 
    312313            env <- ask 
    313             writeVar (cast "$*_") val 
    314             return . VControl $ ControlEnv env 
    315     trapVal val $ case rest of 
    316         Ann _ (Syn "env" [])    -> writeEnv 
    317         Syn "env" []            -> writeEnv 
     314            return . VControl $ ControlContinuation env val cc 
    318315        _                       -> reduce rest 
    319316 
     
    404401    retItem $ castV (key, val) 
    405402 
    406 reduceSyn "env" [] = do 
     403reduceSyn "continuation" [] = callCC $ \cc -> do 
    407404    env <- ask 
    408     -- writeVar "$*_" val 
    409     return . VControl $ ControlEnv env 
     405    return . VControl $ ControlContinuation env undef cc 
    410406 
    411407reduceSyn "block" [exp]