4 ms·
> They could've simply allowed print expr to work as is and accepted it as a wart. Old print isn't an expr at all, that was a major point of the change.
by dragonwriter 5y ago
> They could've simply allowed print expr to work as is and accepted it as a wart.
Old print isn't an expr at all, that was a major point of the change.
- olliej 5y agoI think the person you're replying to was saying that there was no reason to remove the statement form. The only thing that removing the statement form of print did was break existing code. You could easily allow print to act as a function by removing it as a reserved word in expression contexts. They made print a function out of a misplaced sense of language "purity", where they made a random ideal and broke code to support it. Let's compare to JS: 20 years of new features and old code still works. Keywords were added, and old code still works. Even code that uses those keywords still works. It took more effort from the language implementers, but that's as it should be: it took a bit more effort for a few teams (who make the engines), instead of a large amount of effort for tens of thousands of groups.