Zulip Chat Archive

Stream: lean4

Topic: What are the semantics of `Std.Format.line`?


Eric Wieser (Jan 27 2025 at 11:24):

docs#Std.Format.line is documented as

A position where a newline may be inserted if the current group does not fit within the allotted column width.

This seems unclear to me; is the newline allowed to be inserted even if the current group does fit? What if there is no "current group"?

The documentation doesn't seem to specify (or perhaps even contradicts) the second case here:

import Lean

/-- info: No newline -/
#guard_msgs in
#eval (Std.Format.group <| f!"No{Std.Format.line}newline")
/--
info: Has
newline
-/
#guard_msgs in
#eval f!"Has{Std.Format.line}newline"

Last updated: May 02 2025 at 03:31 UTC