src/Pure/attribute.ML
changeset 4918 f66f67577cf3
parent 4850 050481f41e28
child 4997 670b0d4fb9a9
equal deleted inserted replaced
4917:7c22890a7a9b 4918:f66f67577cf3
   147 val get_attributes = get_attributes_sg o Theory.sign_of;
   147 val get_attributes = get_attributes_sg o Theory.sign_of;
   148 
   148 
   149 
   149 
   150 (* get global / local attributes *)
   150 (* get global / local attributes *)
   151 
   151 
   152 fun gen_attr which thy (raw_name, args) =
   152 fun gen_attr which thy =
   153   let
   153   let
   154     val {space, attrs} = get_attributes thy;
   154     val {space, attrs} = get_attributes thy;
   155     val name = NameSpace.intern space raw_name;
   155     val intern = NameSpace.intern space;
   156   in
   156 
   157     (case Symtab.lookup (attrs, name) of
   157     fun attr (raw_name, args) x_th =
   158       None => raise FAIL (name, "unknown attribute")
   158       (case Symtab.lookup (attrs, intern raw_name) of
   159     | Some p => which p args)
   159         None => raise FAIL (intern raw_name, "unknown attribute")
   160   end;
   160       | Some p => which p args x_th);
       
   161   in attr end;
   161 
   162 
   162 val global_attr = gen_attr fst;
   163 val global_attr = gen_attr fst;
   163 val local_attr = gen_attr snd;
   164 val local_attr = gen_attr snd;
   164 
   165 
   165 
   166