anchor.diff:              Globals.rootDispatchers <- Array.zeroCreate cnt
   
               SemanticFunctions.compileAll functions
  -//            for sf in functions do
  -//                SemanticFunctions.compile sf
  -            
  +
  +
  +            Frontend.instance <-
  +                { new IAg with
  +                    member x.GetSynFunction<'r>(name : string) = getSynFunction<'r> name
  +                    member x.GetInhFunction<'r>(name : string) = getInhFunction<'r> name
  +                    member x.GetUntypedSynFunction (name : string) = getUntypedSynFunction name
  +                    member x.AttachValue(target, name, obj) = Globals.attachValue target (Globals.getAttributeIndex name) obj
  +                }
  +
               Log.stop()
  -
  -    let tryGetSynFunction<'a> (name : string) : Option<obj -> 'a> =
  -        match Globals.tryGetAttributeIndex name with
  -            | Some i ->
  -                match Globals.synDispatchers.[i] with
  -                    | null -> None
  -                    | :? IDispatcher<Scope, 'a> as d ->
  -                        let f = fun (n : obj) -> d.Invoke(n, Scope(null, n))
  -                        Some f
  -                    | _ -> None
  -            | None ->
  -                None
  -    
  -    let getSynFunction<'a> (name : string) : obj -> 'a =
  -        match tryGetSynFunction<'a> name with
  -            | Some f -> f 
  -            | _ -> failwithf "[Ag] could not get syn rule for '%s'" name
   
   
   module NewestAgDemo =
  
positive.code: open Aardvark.Base.Incremental
  
  module Ag =
      [<AutoOpen>]
      module Frontend =
          type AttributeKind =
              | None          = 0x00
              | Inherited     = 0x01
  
negative.code:                         x.Cache <- Map.add i (res |> Option.map (fun v -> v :> obj)) x.Cache
                          res
  
              member x.TryInheritUntypedInternal(i : int, disp : IObjectDispatcher<Scope>, root : IObjectDispatcher) : Option<obj> =
                  match x.TryGet i with
                      | Some r -> Some r
                      | None ->
                          let res = 
                              match x.Parent with
                                  | null -> 
                                      match root.TryInvoke(x.Node) with
                                          | (true, v) -> Some v
                                          | _ -> None
  
                                  | p -> 
                                      match disp.TryInvoke(p.Node, p) with
                                          | (true, res) -> Some res
                                          | _ -> p.TryInheritUntypedInternal(i, disp, root)
                          x.Cache <- Map.add i res x.Cache
                          res
  
  
              member x.Get(i : int) =
                  match x.TryGet i with
                      | Some v -> v
  