Why Does _ Form As Space, Not Underscore?

It's deterministic, and therefore entirely predictable. :slight_smile:

If you look just at this situation... it does seem like it might be a design flaw.

But...

The choice to bend the mechanics for SPACE and NEWLINE is directly tied to the prevalence of spaces and newlines, and the objective difficulty of representing them otherwise. On the other hand, underscores and hash marks are less commonly spoken about... and representing them with #_ and #"#" are worthwhile tradeoffs.

(For more information, see: "Space Runes: Reified Unreassignable Nothingness").

If You Want Source Representation, Use MOLD

Had you written append string mold item instead of just append string item it would have given you the desired result.

It would have also expanded the code so it worked with all legal single-character tokens (including the ones that won't implicitly convert to string):

>> for-each 'item [
       ? * + - = |     ; word!s - ordinary
       < > : / . %     ; word!s - special (limited in some contexts)
       #               ; rune! - "hash"/"octothorpe"/"pound"
       _               ; rune! - "space"
       $               ; tied! - tied "space" rune
       ^               ; metaform! - meta "space" rune
       @               ; pinned! - pinned "space" rune
       ~               ; quasiform! - quasi "space" rune (a "quasar")
       ,               ; comma!
   ][
       append string mold item
   ]

>> string
== "?*+-=<>|:/.%#_$^@~,"

(Do note the situation is still contrived. You can't expect to put an arbitrary single character into lists and have it work out here. Consider [ or " or ) etc. But I think it's impressive that it covers as much as it does!)