Stream: beginners

Topic: Formatting


view this post on Zulip jan kili (Feb 09 2022 at 05:15):

What's the intended/ideal multi-line formatting for the following?

a = {
    b: c,
    d: {
        e: f,
    },
}

view this post on Zulip jan kili (Feb 09 2022 at 05:19):

I can't write multi-line records in the repl, but in a module the above fails to parse while the below doesn't:

a = {
    b: c,
    d: {
        e: f,
    },
    }

That seems a little weird :/

view this post on Zulip jan kili (Feb 09 2022 at 05:21):

I feel like the first example failing to parse is a bug... or maybe the second example successfully parsing is a bug instead! :laughing:

view this post on Zulip Anton (Feb 09 2022 at 08:55):

This way works and looks nice:

a =
    {
        b: c,
        d: {
            e: f,
        },
    }

I do think the first one not parsing is a bug.

view this post on Zulip jan kili (Feb 09 2022 at 12:24):

Ooh, that's pretty and practical, thank you!
I'll report that parsing bug, then.

view this post on Zulip Richard Feldman (Feb 09 2022 at 12:52):

it's actually not a bug, unless we want to make the parser more complicated :big_smile:

view this post on Zulip Richard Feldman (Feb 09 2022 at 12:52):

which I guess we've never fully explored, so I'll post about it in #ideas > outdent parsing


Last updated: Jul 05 2025 at 12:14 UTC