Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

タクティク衛生(tactic hygiene)の例: タクティクの中で識別子を導入する #669

Closed
Seasawher opened this issue Aug 23, 2024 · 0 comments · Fixed by #935

Comments

@Seasawher
Copy link
Member

/- ## タクティクの中で識別子を導入する例 -/

macro "my_intro" : tactic => `(tactic| intro h)


example (P : Prop) : P → P := by
  my_intro

  -- `h : P` がマクロ展開によって導入されはするが、
  -- 死んでいるので使えない
  fail_if_success exact h

  assumption

set_option hygiene false in

macro "my_intro'" : tactic => `(tactic| intro h)

example (P : Prop) : P → P := by
  my_intro'

  -- 衛生的ではないので、`h : P` が使えてしまう
  exact h
@Seasawher Seasawher modified the milestones: メタプログラミングとタクティク, メタプログラミングとタクティク作成、カスタマイズ Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant