std.compress

Timothee Cour thelastmammoth at gmail.com
Sun Jun 9 18:20:44 PDT 2013


On Sun, Jun 9, 2013 at 12:53 AM, Jonathan M Davis <jmdavisProg at gmx.com>wrote:

> On Sunday, June 09, 2013 17:12:16 Daniel Murphy wrote:
> > "Andrei Alexandrescu" <SeeWebsiteForEmail at erdani.org> wrote in message
> > news:koncgm$9f5$1 at digitalmars.com...
> >
> > > On 6/5/13 2:55 AM, Timothee Cour wrote:
> > >> What I suggested in my original post didn't involve any
> > >> indirection/abstraction; simply a renaming to be consistent with
> > >> existing zlib (see my points A+B in my 1st post on this thread):
> > >>
> > >> std.compress.zlib.compress
> > >> std.compress.zlib.uncompress
> > >> std.compress.lzw.compress
> > >> std.compress.lzw.uncompress
> > >
> > > I think that's nice.
> > >
> > > Andrei
> >
> > This has the problem that you now can't import more than one compression
> > module and still use ufcs.  The annoying one I keep hitting in phobos is
> > std.file.write vs std.stdio.write.  For range-based APIs it is a huge
> pita
> > to have to switch away from ufcs.  I think xyzCompress is still pretty
> > sweet, consistent, and completely fixes the problem.  It has the added
> > benefit that you can tell which compression algorithm is being used
> without
> > having to know what is imported.
>
> That can be fixed by using a local alias, but it's true that it's an extra
> annoyance.
>
> - Jonathan M Davis
>

which is why I have suggested supporting UFCS with fully qualified function
names:

auto a="".(std.path.join)("\n");
myfile.(std.file.write)(text);
text.(std.stdio.write);

see post: support UFCS with fully qualified function names (was in
"digitalmars.D.learn")
http://forum.dlang.org/post/mailman.1453.1369099708.4724.digitalmars-d@puremagic.com

it also helps searchability: if one uses local aliases such as import
std.stdio:write2=write, naive searching via grep 'write(' will miss such
cases. The increase in complexity is minimal, and the feature makes sense
with the rest of the language.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130609/e4885168/attachment-0001.html>


More information about the Digitalmars-d mailing list