From 2243c25c79ab19876ad74452c9cecc7dcc88c67c Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Mon, 9 Apr 2018 01:33:31 +0200 Subject: [ltac] Deprecate nameless fix/cofix. LTAC's `fix` and `cofix` do require access to the proof object inside the tactic monad when used without a name. This is a bit inconvenient as we aim to make the handling of the proof object purely functional. Alternatives have been discussed in #7196, and it seems that deprecating the nameless forms may have the best cost/benefit ratio, so opening this PR for discussion. See also #6171. --- tactics/tactics.ml | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tactics') diff --git a/tactics/tactics.ml b/tactics/tactics.ml index d0ec3358a..6561a86c2 100644 --- a/tactics/tactics.ml +++ b/tactics/tactics.ml @@ -557,8 +557,13 @@ let mutual_fix f n rest j = Proofview.Goal.enter begin fun gl -> end end +let warning_nameless_fix = + CWarnings.create ~name:"nameless-fix" ~category:"deprecated" Pp.(fun () -> + str "fix/cofix without a name are deprecated, please use the named version.") + let fix ido n = match ido with | None -> + warning_nameless_fix (); Proofview.Goal.enter begin fun gl -> let name = Proof_global.get_current_proof_name () in let id = new_fresh_id Id.Set.empty name gl in @@ -610,6 +615,7 @@ end let cofix ido = match ido with | None -> + warning_nameless_fix (); Proofview.Goal.enter begin fun gl -> let name = Proof_global.get_current_proof_name () in let id = new_fresh_id Id.Set.empty name gl in -- cgit v1.2.3