diff options
author | Clément Pit--Claudel <clement.pitclaudel@live.com> | 2015-05-02 17:36:05 -0400 |
---|---|---|
committer | Pierre Letouzey <pierre.letouzey@inria.fr> | 2015-06-22 14:32:19 +0200 |
commit | d6ee11ac2190df5adad63e5125a9e583533e49e0 (patch) | |
tree | a81a39f25bb0553a2d19ec919637a2b4eb84a5b7 | |
parent | 192e683d414ac86d213e2386da40dd7aa5a2fccd (diff) |
Replace 'try ... with Failure "List.last"' with 'if l <> []'
-rw-r--r-- | toplevel/vernacentries.ml | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/toplevel/vernacentries.ml b/toplevel/vernacentries.ml index c4be56f53..86ba38186 100644 --- a/toplevel/vernacentries.ml +++ b/toplevel/vernacentries.ml @@ -105,16 +105,13 @@ let show_intro all = if gls <> [] then begin let gl = {Evd.it=List.hd gls ; sigma = sigma; } in let l,_= decompose_prod_assum (strip_outer_cast (pf_concl gl)) in - if all - then + if all then let lid = Tactics.find_intro_names l gl in msg_notice (hov 0 (prlist_with_sep spc pr_id lid)) - else - try - let n = List.last l in - msg_notice (pr_id (List.hd (Tactics.find_intro_names [n] gl))) - with Failure "List.last" -> () - end + else if l <> [] then + let n = List.last l in + msg_notice (pr_id (List.hd (Tactics.find_intro_names [n] gl))) + end (** Prepare a "match" template for a given inductive type. For each branch of the match, we list the constructor name |