Zulip Chat Archive

Stream: general

Topic: meta indenting


Yaël Dillies (Sep 02 2021 at 16:08):

What's the indenting convention for tactic writing? I'm a bit puzzled by those 3 spaces after do.

Johan Commelin (Sep 02 2021 at 16:47):

I think that's an artifact of "do ".length = 3

Yaël Dillies (Sep 02 2021 at 16:48):

Uh? Why so?

Eric Wieser (Sep 02 2021 at 16:48):

I guess arguably

do
  foo,
  bar

would be a better style than the style that motivates the 3 spaces:

do foo,
   bar

Yaël Dillies (Sep 02 2021 at 16:49):

Ah yeah, if you start on the same line.

Rob Lewis (Sep 02 2021 at 17:10):

There isn't one established convention, we're inconsistent about it

Rob Lewis (Sep 02 2021 at 17:11):

You'll also see

meta def blah := do
  foo,
  bar

Rob Lewis (Sep 02 2021 at 17:11):

And possibly

meta def blah := do
foo,
bar

?

Yaël Dillies (Sep 02 2021 at 17:14):

Yes I did :sad:

Mario Carneiro (Sep 03 2021 at 02:39):

I also use

do foo,
  bar,
  baz

because "visual indent" is a pain on vscode

Mario Carneiro (Sep 03 2021 at 02:40):

but I think you should generally prefer Rob's first version when possible, especially since that's the style in lean 4


Last updated: Dec 20 2023 at 11:08 UTC