dmdz

Walter Bright newshound1 at digitalmars.com
Thu Mar 18 15:09:29 PDT 2010


Andrei Alexandrescu wrote:
> On 03/18/2010 04:22 PM, Walter Bright wrote:
>> Andrei Alexandrescu wrote:
>>>> Is it really necessary to support streaming archives?
>>> It is not necessary, only vital.
>>
>> I understand your point.
>>
>> But I still would like a way to build and read archives entirely in
>> memory. One reason is that's how dmd is able to generate libraries so
>> quickly.
> 
> Makes sense.
> 
> (On the read side, reading in memory is not a problem if reading from a 
> stream is defined - just use the streaming interface to load stuff in 
> memory. For the writing part we need the mythical streaming abstraction 
> that replaces current streams...)
> 
> Andrei

Maybe a better way to do it is to just pass a delegate that encapsulates a 
reader, and a delegate for the writing. That way, both streams and in-memory 
buffers will work with the same interface, and the archiver need know nothing 
about streams or memory.

Some default delegates can be provided that interface to streams, files, and 
memory buffers.

Or maybe just pass a range!



More information about the Digitalmars-d mailing list