src/HOL/Library/datatype_records.ML
changeset 72450 24bd1316eaae
parent 72154 2b41b710f6ef
child 74561 8e6c973003c8
equal deleted inserted replaced
72449:e1ee4a9902bd 72450:24bd1316eaae
   177       Local_Theory.define ((name, NoSyn), ((Binding.empty, @{attributes [datatype_record_update, code]}),t))
   177       Local_Theory.define ((name, NoSyn), ((Binding.empty, @{attributes [datatype_record_update, code]}),t))
   178       #> apfst (apsnd snd)
   178       #> apfst (apsnd snd)
   179 
   179 
   180     val (updates, (lthy'', lthy')) =
   180     val (updates, (lthy'', lthy')) =
   181       lthy
   181       lthy
   182       |> Local_Theory.open_target
   182       |> (snd o Local_Theory.begin_nested)
   183       |> Local_Theory.map_background_naming (Name_Space.qualified_path false (Binding.name short_name))
   183       |> Local_Theory.map_background_naming (Name_Space.qualified_path false (Binding.name short_name))
   184       |> @{fold_map 2} define (map mk_name sels) (Syntax.check_terms lthy (map mk_t (0 upto len - 1)))
   184       |> @{fold_map 2} define (map mk_name sels) (Syntax.check_terms lthy (map mk_t (0 upto len - 1)))
   185       ||> `Local_Theory.close_target
   185       ||> `Local_Theory.end_nested
   186 
   186 
   187     val phi = Proof_Context.export_morphism lthy' lthy''
   187     val phi = Proof_Context.export_morphism lthy' lthy''
   188 
   188 
   189     val (update_ts, update_defs) =
   189     val (update_ts, update_defs) =
   190       split_list updates
   190       split_list updates