Zulip Chat Archive

Stream: lean4

Topic: Prevent execution of `#eval` during editing


Mac (May 19 2021 at 18:34):

Is there a way to print heavy duty #evals (i.e. side-effect commands) from running in the editor (i.e. only running when the file is directly run with lean)?

Mario Carneiro (May 19 2021 at 19:23):

you can use def main := instead of #eval

Mac (May 19 2021 at 19:31):

main isn't run by lean though? main is only used in the built executable? I want to run the #eval at interpretation time but not editing time.

Mario Carneiro (May 19 2021 at 19:35):

won't that make them diverge?

Mario Carneiro (May 19 2021 at 19:36):

#eval can modify the environment

Mac (May 19 2021 at 19:39):

yes, but that's the point. If #eval is doing heavy duty IO work like compiling code or building a project, I don't want that run every time the editor is opened or refreshed.


Last updated: Dec 20 2023 at 11:08 UTC