Range with lookaround

qznc via Digitalmars-d digitalmars-d at puremagic.com
Thu Mar 2 04:51:28 PST 2017


On Thursday, 2 March 2017 at 01:44:19 UTC, Andrei Alexandrescu 
wrote:
> May be worth discussing in here: 
> https://issues.dlang.org/show_bug.cgi?id=17238 -- Andrei

I don't understand the use case. PR #5153 seems to be about 
getting the last element, not about some lookahead. When I think 
about lookahead, I always think of parsers. If the lexer provides 
an input range of tokens, my recursive descent parser might need 
3 tokens lookahead, for example. For the lexer input a "push back 
a character into my input" is more convenient.

Should it give some performance guarantees? I guess, we don't 
want to refresh the buffers at every popFront, so it would 
probably be as lazy as possible.



More information about the Digitalmars-d mailing list