Zulip Chat Archive

Stream: lean4

Topic: Newlines are stripped by `m!`


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

Is this deliberate behavior for docs#Lean.MessageData interpolation?

import Lean

#eval Lean.logInfo <| f!"Newline\nplease"  --ok
#eval Lean.logInfo <| Std.Format.group <| f!"Newline\nplease"  --ok

#eval Lean.logInfo <| m!"Newline\nplease"  --ok
#eval Lean.logInfo <| Lean.MessageData.group <| m!"Newline\nplease"  --no newline

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

(If you look at the generated term, m! is sneakily replacing \n with Format.line)


Last updated: May 02 2025 at 03:31 UTC