buffered input

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Feb 6 16:00:54 PST 2011


On 2/6/11 4:51 PM, spir wrote:
> On 02/06/2011 08:49 PM, Tomek Sowiński wrote:
>> Andrei Alexandrescu napisał:
>>
>>>> Also: could a (truely) circular buffer help& solve the above copy
>>>> problem, concretely?
>>>
>>> Not if you want infinite lookahead, which I think is what any modern
>>> buffering system should offer.
>>
>> Truely circular, probably not, but a wrap-around slice (circular view
>> of length at most underlying.length) does offer that and solves the
>> copy problem with style.
>
> Right.

With fixed lookahead you can't do a lot of things - such as line 
continuation in C programs or CSV files. There are plenty of other 
examples. Generally I believe k-lookahead is a thing of the past and 
infinite-lookahead is where the future is.

Andrei



More information about the Digitalmars-d mailing list