Changeset 14421 for src/Pugs/Eval.hs

Show
Ignore:
Timestamp:
10/22/06 01:36:33 (2 years ago)
Author:
seano
Message:

* Turn of "strict 'vars'" for -e scripts via the non-standard variable

$?STRICT. This will go away with lexical pragmas. (Note: you can
also de-strict your pugs interactive experience with "$?STRICT=0".)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Eval.hs

    r14353 r14421  
    269269reduceVal v = retVal v 
    270270 
     271isStrict = do 
     272    vb <- fromVal =<< readVar (cast "$?STRICT") 
     273    return vb 
     274 
    271275-- Reduction for variables 
    272276reduceVar :: Var -> Eval Val 
     
    288292                    lv <- asks envLValue 
    289293                    if lv then evalExp (Sym SGlobal var (Var var)) else retEmpty 
    290                 | otherwise         -> retError "Undeclared variable" var 
     294                | otherwise -> do 
     295                    s <- isStrict 
     296                    if s then retError "Undeclared variable" var 
     297                         else do lv <- asks envLValue 
     298                                 if lv then evalExp (Sym SGlobal var (Var var)) else retEmpty 
    291299 
    292300_scalarContext :: Cxt