Zulip Chat Archive

Stream: metaprogramming / tactics

Topic: decl_noncomputable_reason


Eric Wieser (Oct 30 2021 at 10:41):

What's going on here with docs#environment.decl_noncomputable_reason (new in the latest lean)? It seems to work from within run_cmd, but fail from within eval.

open tactic

def foo :  := 1

-- 'failed'
#eval do
  e  get_env,
  f  e.decl_noncomputable_reason `foo,
  trace f

-- ok
run_cmd do
  e  get_env,
  trace $ e.decl_noncomputable_reason `foo


noncomputable def bar :  := classical.choice sorry

-- ok
#eval do
  e  get_env,
  f  e.decl_noncomputable_reason `bar,
  trace f

-- ok
run_cmd do
  e  get_env,
  trace $ e.decl_noncomputable_reason `bar

Eric Wieser (Oct 30 2021 at 10:46):

Oh, this is nothing to do with the definition and everything to do with

Eric Wieser (Oct 30 2021 at 10:48):

I was not aware of docs#tactic.opt_to_tac

Notification Bot (Oct 30 2021 at 10:48):

This topic was moved here from #general > decl_noncomputable_reason by Eric Wieser


Last updated: Dec 20 2023 at 11:08 UTC