anchor.diff:      let isInsideDynamicScope (ps:Types.State) =
         globalDynamicScopeLevel ps > 0
   
  +    let modifyTopScope sr fn = 
  +      match getScopeChain !sr with
  +      | []     -> failwith "Empty scope-chain"
  +      | fs::tl -> sr := {!sr with ScopeChain = fn fs::tl}
  +
       let enterScope sr (parms:AntlrToken seq) =
         let variables = 
           Seq.mapi (fun i (t:AntlrToken) -> 
  
positive.code:                   }
  
                    fs // return old top-scope
        | _     -> failwith "Couldn't exit scope"
  
      let enterDynamicScope sr =
  
negative.code:           Global(name, sl.Global)
  
      let assignedFrom sr name node =
        modifyTopScope sr (fun fs ->
          let lv  = fs.Variables.[name]
          Scope.setLocal fs name {lv with AssignedFrom = node :: lv.AssignedFrom}
        )
  
      let usedAs sr name typ =
        modifyTopScope sr (fun fs ->
          let lv = fs.Variables.[name]
          Scope.setLocal fs name {lv with UsedAs = lv.UsedAs ||| typ}
        )
  
      let usedWith sr name rname =
        modifyTopScope sr (fun fs ->
          let lv = fs.Variables.[name]
          Scope.setLocal fs name {lv with UsedWith = lv.UsedWith.Add(rname)}
        )
  
      let usedWithClosure sr name rname =
        modifyTopScope sr (fun fs ->
          let lv = fs.Variables.[name]
          Scope.setLocal fs name {lv with UsedWithClosure = lv.UsedWithClosure.Add(rname)}
        )
    
      let analyzeAssign sr left right =
      
  