coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Robbert Krebbers <mailinglists AT robbertkrebbers.nl>
- To: Coq Club <coq-club AT inria.fr>
- Subject: [Coq-Club] Tactic Notation and lists
- Date: Tue, 12 Apr 2016 11:24:59 +0200
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=mailinglists AT robbertkrebbers.nl; spf=None smtp.mailfrom=mailinglists AT robbertkrebbers.nl; spf=None smtp.helo=postmaster AT smtp1.science.ru.nl
- Ironport-phdr: 9a23:Cyq/zR29+KrHQHsxsmDT+DRfVm0co7zxezQtwd8ZsegeLvad9pjvdHbS+e9qxAeQG96Lu7QZ0qGP7+jJYi8p39WoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6kO74TNaIBjjLw09fr2zQd6CyZnunLnus7ToICx2xxOFKYtoKxu3qQiD/uI3uqBFbpgL9x3Sv3FTcP5Xz247bXianhL7+9vitMU7q3cYk7sb+sVBSaT3ebgjBfwdVWx+cjN92Mq+nh7aBSCL+3FUBm4Ri19DBxXPxBD8RJb49CXg4LlTwi6faPfxR7o5QyjqzL1mQhXlkjxPYzsw8WXWjMN0jblHuzq7oBZ1zpTIY5uYPvBzZLibe9dMFjkJZdpYSyEUWtD0VIAIFedUeL8A94Q=
Hello club,
In Tactic Notations one can use lists as arguments, and pass these to other tactics that accept lists as arguments, for example:
Tactic Notation "foo" ident_list(Hs) := revert Hs.
I am wondering whether it is possible to manipulate such lists in Ltac.
For example, could one iterate over these lists, like:
Tactic Notation "foo" ident_list(Hs) :=
let rec go Hs :=
match Hs with
| nil => idtac
| ?H :: ?Hs => my_tactic H; go Hs
end
in go Hs.
Since I do not know how to do this (and whether it is even possible), I often end up writing code like the following:
Tactic Notation "foo" ident(H1) := my_tactic H1;
Tactic Notation "foo" ident(H1) ident(H2) :=
my_tactic H1; my_tactic H2.
Tactic Notation "foo" ident(H1) ident(H2) ident(H3) :=
my_tactic H1; my_tactic H2; my_tactic H3.
This obviously does not scale, and becomes very tedious with Tactic Notations that take multiple arguments, especially if they take multiple lists as arguments.
Best,
Robbert
PS: I often use Coq lists to circumvent this problem, but that only works as a replacement for constr_list, but not for arguments of e.g. type ident_list or simple_intropattern_list.
- [Coq-Club] Tactic Notation and lists, Robbert Krebbers, 04/12/2016
- Re: [Coq-Club] Tactic Notation and lists, Pierre-Marie Pédrot, 04/12/2016
- Re: [Coq-Club] Tactic Notation and lists, Robbert Krebbers, 04/12/2016
- Re: [Coq-Club] Tactic Notation and lists, Pierre-Marie Pédrot, 04/12/2016
- Re: [Coq-Club] Tactic Notation and lists, Robbert Krebbers, 04/12/2016
- Re: [Coq-Club] Tactic Notation and lists, Pierre-Marie Pédrot, 04/12/2016
- Re: [Coq-Club] Tactic Notation and lists, Robbert Krebbers, 04/12/2016
- Re: [Coq-Club] Tactic Notation and lists, Pierre-Marie Pédrot, 04/12/2016
- Re: [Coq-Club] Tactic Notation and lists, Robbert Krebbers, 04/12/2016
- Re: [Coq-Club] Tactic Notation and lists, Pierre-Marie Pédrot, 04/12/2016
- Re: [Coq-Club] Tactic Notation and lists, Pierre-Marie Pédrot, 04/12/2016
Archive powered by MHonArc 2.6.18.