Hacker News new | ask | show | jobs
by Pxtl 4289 days ago
I would've gone with spaces. Those are the official standard here in Canada as a pragmatic compromise between anglos and francos that have opposing usage of comma/dot.

So instead of 1,234.56789 (English) or 1.234,56789 (French) we do 1 234.56789 (international)

[0-9]+ [0-9]+ has no meaning in C++, so using space for magnitude decorations would have worked.

2 comments

Nice, it fits well with the "adjacent strings are automatically concatenated by the compiler" rule, too.
Have you considered if this would fit with C++'s grammar?
Briefly, but I think there are like three people in the world that fully grok C++ grammar, and I'm definitely not one of them. I just know that C++ generally has some kind of infix operator or delimiter between pairs of immediate data or variables, I'm pretty sure it's currently just a compiler error in every case.
Except this is not C++ grammar, this is simple lexical analysis. And separating by spaces would work fine.
What about semantics? Probably 0.