Skip to content

Separate hash map elements with comma in printer output #1275

@jasalt

Description

@jasalt

Currently (Basilisp 0.4.0) hash maps are printed without kv-pairs separated in any way, making it hard to know which is a key and which is a value:

basilisp.user=> {:1 :2 :3 :4 :5 :6 :7 :8 :9 :10}
{:1 :2 :3 :4 :5 :6 :7 :8 :9 :10}

Clojure adds convenient comma in between (example with Babashka v1.12.203 REPL):

user=> {:1 :2 :3 :4 :5 :6 :7 :8 :9 :10}
{:1 :2, :3 :4, :5 :6, :7 :8, :9 :10}

This would make reading complex hash maps easier when printing them out. The reader discards the commas (as Clojure does) so copy-pasting printed hash maps with commas for evaluation works fine.

Issue copy-pasted from phel-lang/phel-lang#957.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions