buffered input

spir denis.spir at gmail.com
Sat Feb 5 16:09:04 PST 2011


On 02/05/2011 11:00 PM, Nick Sabalausky wrote:
>> Transparent buffering sounds sensible but in fact it robs you of important
>> >  capabilities. It essentially forces you to use grammars with lookahead 1
>> >  for all input operations. Being able to peek forward into the stream
>> >  without committing to read from it allows you to e.g. do operations like
>> >  "does this stream start with a specific word" etc. As soon
>> >
> That shouldn't be a problem for the cases where a lookahead of 1 is all
> that's needed. So both types can exist (with the traditional/automatic type
> most likely built on top of Andrei's type). Thus, I think the only question
> is "Are the appropriate use-cases for the traditional/automatic type minor
> enough and infrequent enough to actively discourage it by not providing it?"
> That I can't answer.

And what about backtracking (eg for parsing the source)?

Denis
-- 
_________________
vita es estrany
spir.wikidot.com



More information about the Digitalmars-d mailing list