On 4/6/2014 12:39 PM, "Ola Fosheim Grøstad"
<[email protected]>" wrote:
On Saturday, 5 April 2014 at 23:26:30 UTC, Walter Bright wrote:
I feel that C++ messed up namespace design because:
1. namespaces are not closed
2. they have no relationship with modules
Namespaces are not as powerful as they could have been, but being able to add
symbols to an external scope (like classes) is very useful if done right (e.g.
cross-cutting enhancements, adding members to external classes like
"saveyourself", "printyourself").
It's seriously wrong to allow such. It makes a larger code base nearly
impossible to reliably reason about, leading one to rely on conventions like
"don't add stuff to namespaces".
D has closed scopes, and members can be "added" to external classes just fine,
using CTFE.