How has std::hash_map!{} been received?

⚓ Rust    📅 2026-06-20    👤 surdeus    👁️ 2      

surdeus

I come from Perl, AFAIK the only other language with a (there more powerful) => pair operator. Yet I feel this choice is a huge pity! It’s not compatible with itself, since even in nightly : remains the Debug separator. I guess that will stay, as a change would break backward compatibility. (I dunno, but could see some being tempted to use Debug as a dependency free ok-ish json!() alternative.)

Structs also use :. To me they are kinda the static counterpart to HashMaps. So extending what macros allow, i.e. $($key:expr: $value:expr),*, would be a consistent, non-breaking way forward!

Outside of Rust : is likewise pretty standard, across JSON, YAML, RON, TOON, MAML, EON, and, unrelated but similar, Css.

11 posts - 5 participants

Read full topic

🏷️ Rust_feed