std.compress

Daniel Murphy yebblies at nospamgmail.com
Sun Jun 9 00:12:16 PDT 2013


"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.

I would not have a problem with each module providing both 'compress' and 
'xyzCompress', but that is against phobos policy. 




More information about the Digitalmars-d mailing list