| 1 |
(* Slightly improving interpretation of Ltac subterms in notations *) |
| 2 |
|
| 3 |
Notation "'var2' x .. y = z ; e" := (ltac:(exact z), (fun x => .. (fun y => e) |
| 4 |
..)) (at level 200, x binder, y binder, e at level 220). |
| 5 |
Check (var2 a = 1; a). |
| 6 |
|
| 7 |
Require Import Ltac2.Ltac2. |
| 8 |
|
| 9 |
Notation "'var3' x .. y = z ; e" := (ltac2:(exact $preterm:z), (fun x => .. (fun y => e) |
| 10 |
..)) (at level 200, x binder, y binder, e at level 220). |
| 11 |
Check (var3 a = 1; a). |
| 12 |
|
| 13 |
Fail Notation "'var4' x .. y = z ; e" := (ltac2:(let _ := x in exact 0), (fun x => .. (fun y => e) |
| 14 |
..)) (at level 200, x binder, y binder, e at level 220). |