Free functions versus member functions
Regan Heath
regan at netmail.co.nz
Thu Oct 11 01:55:23 PDT 2007
Kris wrote:
> Yes, that perspective resonates, though I tend to use the term 'client
> functions' to describe what Scott is calling non-member functions.
>
> There's some specific interest here with regard to D:
>
> 1) the Widget factory example is less clear in D, due to that lack of an
> equivalent 'namespace' mechanism. This is why such methods tend to reside
> inside the respective class/struct in D. Yes, one could perhaps use "import
> as" instead, but that would tend to muddy usage further. I think this
> indicates a minor annoyance with the D namespace mechanism. One that's
> bothered me from time to time <g>
What about D's modules or packages, aren't they the equivalent of a
namespace? If not, what do they lack?
Regan
More information about the Digitalmars-d
mailing list