[RFC] I/O and Buffer Range

Dmitry Olshansky dmitry.olsh at gmail.com
Mon Dec 30 00:08:18 PST 2013


30-Dec-2013 09:29, Marco Leise пишет:
> Am Sun, 29 Dec 2013 22:45:35 +0000
> schrieb "Vladimir Panteleev" <vladimir at thecybershadow.net>:
>
>> [snip]
>>
>> 2. I don't understand the rationale behind the current semantics
>> of lookahead/lookbehind. If you want to e.g. peek ahead/behind to
>> find the first whitespace char, you don't know how many chars to
>> request. Wouldn't it be better to make these functions return the
>> ENTIRE available buffer in O(1)?
>
> Yeah, been there too. I guess after X years of programming
> chances are good you implemented some buffer with
> look-ahead. :)
>
> I use those primitives:
>
>     ubyte[] mapAvailable() pure nothrow
>     ubyte[] mapAtLeast(in ℕ count)
>

Yeah, that's a good idea.
I mean primitives, not Unicode in type names ;)


-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list