anchor.diff:  
               ()
   
  +    [<AutoOpen>]
  +    module private Functions =
  +        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 current = CurrentScope.Instance
  +                            let f = fun (n : obj) -> 
  +                                match d with
  +                                    | :? Scope as s -> d.Invoke(s.Node, s)
  +                                    | _ -> d.Invoke(n, Scope(current, 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
  +
  +        let tryGetInhFunction<'a> (name : string) : Option<obj -> 'a> =
  +            match Globals.tryGetAttributeIndex name with
  +                | Some i ->
  +                    let current = CurrentScope.Instance
  +                    let f = fun (n : obj) -> 
  +                        match n with
  +                            | :? Scope as s -> s.Inherit(i)
  +                            | _ -> current.Inherit(i)
  +                    Some f
  +                | None ->
  +                    None
  +
  +        let getInhFunction<'a> (name : string) : obj -> 'a =
  +            match tryGetSynFunction<'a> name with
  +                | Some f -> f 
  +                | _ -> failwithf "[Ag] could not get inh rule for '%s'" name
  +        
  +        let tryGetUntypedSynFunction (name : string) : Option<obj -> obj> =
  +            match Globals.tryGetAttributeIndex name with
  +                | Some i ->
  +                    match Globals.synDispatchers.[i] with
  +                        | null -> None
  +                        | d ->
  +                            let current = CurrentScope.Instance
  +                            let f = fun (n : obj) ->
  +                                match n with
  +                                    | :? Scope as s -> 
  +                                        match d.TryInvoke(s.Node, s) with
  +                                            | (true, v) -> v
  +                                            | _ -> failwithf "[Ag] could not get syn attribute '%s' for %A" name n
  +                                    | _ ->
  +                                        match d.TryInvoke(n, Scope(current, n)) with
  +                                            | (true, v) -> v
  +                                            | _ -> failwithf "[Ag] could not get syn attribute '%s' for %A" name n
  +                            Some f
  +                | None ->
  +                    None
  +                
  +        let getUntypedSynFunction (name : string) =
  +            match tryGetUntypedSynFunction name with
  +                | Some f -> f 
  +                | _ -> failwithf "[Ag] could not get syn rule for '%s'" name
  +
  +
  +    let tryGetAttributeValue (n : obj) (name : string) =
  +        let scope = 
  +            match n with
  +                | :? Scope as s -> s
  +                | _ -> Scope(CurrentScope.Instance, n)
  +
  +        match Globals.tryGetAttributeIndex name with
  +            | Some i when i >= 0 && i < Globals.synDispatchers.Length ->
  +                match Globals.synDispatchers.[i] with
  +                    | null ->
  +                        scope.TryInheritUntyped i
  +                    | d ->
  +                        match d.TryInvoke(n, scope) with
  +                            | (true, res) -> Some res
  +                            | _ -> None
  +
  +            | Some i ->
  +                scope.TryInheritUntyped i
  +
  +            | None ->
  +                None
  +
  +
  +
  +
       let mutable private initialized = 0
       let init() =
           if System.Threading.Interlocked.Exchange(&initialized, 1) = 0 then
  
positive.code: open Aardvark.Base.Incremental
  
  module Ag =
      [<AutoOpen>]
      module Frontend =
          type AttributeKind =
              | None          = 0x00
              | Inherited     = 0x01
  
negative.code:         [<MethodImpl(MethodImplOptions.NoInlining)>]
          let (?) (o : 'a) (name : string) : 'b =
              if IsFunction<'b>.Value then
                  let v = instance.GetUntypedSynFunction name (o :> obj)
                  Aardvark.Base.NewAg.Delay.delay v
              else
                  instance.GetInhFunction<'b> name (o :> obj)
   
          [<MethodImpl(MethodImplOptions.NoInlining)>]
          let (?<-) (o : 'a) (name : string) (value : 'b) : unit =
              instance.AttachValue(o, name, value)
              
              
          [<MethodImpl(MethodImplOptions.NoInlining)>]
          let (<<=) (m : Inh) (value : 'a) = ()
  