Zulip Chat Archive

Stream: lean4

Topic: Where is func `String -> Syntax` used by syntax declaration?


nrs (Oct 31 2024 at 00:30):

I'm learning about Lean metaprogramming, and I was wondering whether there was a command I could call to get the inhabitant declaration for Syntax for a piece of Lean code. Alternatively, the actual function String -> Syntax that does this transformation would be super useful too!

Mario Carneiro (Oct 31 2024 at 00:43):

What function do you mean?

Mario Carneiro (Oct 31 2024 at 00:44):

Do you want to call the parser on a term or something?

nrs (Oct 31 2024 at 00:45):

Mario Carneiro said:

Do you want to call the parser on a term or something?

Yeah, for instance I want to get the Syntax inhabitant for fun n => n + n or def myNat : Nat := 2


Last updated: May 02 2025 at 03:31 UTC