[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: ducktyping
- From: "James Dennett" <james.dennett@...>
- Date: Wed, 24 Sep 2008 17:02:46 -0700
On Wed, Sep 24, 2008 at 1:31 PM, Stephen Kellett
>> "loadIdentity()" and so on. How would you solve this problem in an elegant
>> approach in a static language?
> C++, C# and Java all do it using namespaces (or packages).
That covers part of the issue (avoiding name collisions). Another
part is covered by concept_map in C++0x, which allows syntax
adaptation so that calls to MatrixConcept::identity() for a type X
that models MatrixConcept can actually be dispatched to loadIdentity()
or whatever is needed without needing wrapper classes.