Zulip Chat Archive
Stream: lean4
Topic: defining attributes
Moritz Doll (Oct 03 2022 at 17:51):
Hi,
according to lean4/tests/pkg/user_attr/UserAttr/Tst.lean
the simple way to define attributes is TagAttribute ← registerTagAttribute
, but the simple
import Lean
open Lean
initialize blaAttr : TagAttribute ← registerTagAttribute `bla "simple user defined attribute"
@[bla] def test (a : ℕ) := a
fails with unknown attribute [bla]
. Any ideas why this does not work?
Jannis Limperg (Oct 03 2022 at 18:12):
initialize
has no effect in the file where you use it. Once you import this file somewhere else, the initialize
takes effect.
Moritz Doll (Oct 03 2022 at 18:13):
ok, thanks
Last updated: Dec 20 2023 at 11:08 UTC