std.compress

Timothee Cour thelastmammoth at gmail.com
Sun Jun 9 19:06:19 PDT 2013


ok I found what I think is the best solution to this problem :-)
see:
http://forum.dlang.org/post/mailman.1002.1370829729.13711.digitalmars-d-learn@puremagic.com



On Sun, Jun 9, 2013 at 6:59 PM, Jonathan M Davis <jmdavisProg at gmx.com>wrote:

> On Monday, June 10, 2013 11:44:56 Daniel Murphy wrote:
> > In this case we can prevent problem simply by not giving functions
> generic
> > names like 'compress'.  Ideally you should be able to import the entire
> > standard library with no name conflicts.
>
> We've actually made the opposite choice when discussing this in the past.
> We've specifically gone for making functions which do the same thing in
> different modules having the same name (e.g. std.ascii and std.uni), which
> makes swapping one for the other easy and avoids having to come up with
> distinct names, though it does obviously create more naming conflicts when
> you
> try and mix and match such modules. I'd also point out that it's been
> argued
> that it's a failure of the module system if we're specifically trying to
> avoid
> having different modules have functions with the same name. It's the module
> system's job to differentiate such functions, and specifically avoiding
> naming
> stuff the same to avoid naming conflicts means that you're pretty much
> ignoring
> the module system.
>
> So, the general approach has been to name functions differently when they
> do
> different things and name them the same when they do the same thing and
> then
> let the module system take care of differentiating between the two when you
> need to.
>
> - Jonathan M Davis
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130609/9c4c712f/attachment.html>


More information about the Digitalmars-d mailing list