Changeset 16439

Show
Ignore:
Timestamp:
05/18/07 22:39:20 (18 months ago)
Author:
audreyt
Message:

* Variables inside an eval"" is now correctly checked

against outer lexical scope.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Parser/Program.hs

    r16417 r16439  
    110110    , s_closureTraits   = [id] 
    111111    , s_freeVars        = Set.empty 
    112     , s_knownVars       = Map.empty 
     112    , s_knownVars       = Map.map (const topMPad) (padEntries (envLexical env)) 
    113113    , s_outerVars       = Map.empty 
    114114    , s_protoPad        = emptyPad 
    115115    } 
     116 
     117-- ^ A fake 'top' MPad for s_knownVars above to refer to things outside the eval scope. 
     118{-# NOINLINE topMPad #-} 
     119topMPad :: MPad 
     120topMPad = unsafePerformIO $ do 
     121    tvar <- newTVarIO emptyPad 
     122    return $ MkMPad (addressOf tvar) tvar 
    116123 
    117124-- XXX - Pending clarification about those 3 -- are they routine-implicit or block-implicit?