Thread overview
[Issue 17238] r.lookaround!(a, b) returns a range derived from r that allows a elements of lookahead and b elements of lookback
Mar 02, 2017
greenify
Dec 17, 2022
Iain Buclaw
March 02, 2017
https://issues.dlang.org/show_bug.cgi?id=17238

greenify <greeenify@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |greeenify@gmail.com
           Assignee|nobody@puremagic.com        |greeenify@gmail.com

--- Comment #1 from greenify <greeenify@gmail.com> ---
A couple of questions to clarify:

1) popFront/popBack will move the fixed-size buffer, right? For example:

10.iota.ahead(3).drop(2).writeln; // [2, 3, 4]

2)
> it embeds a fixed-size buffer and moves through it with minimal effort.

It's assumed are only shallow which can change?

auto arr = 10.iota.ahead(3);
auto a = arr[1..$]; // [1, 2]
arr.popFront;
auto b = arr[1..$]; // [2, 3]

With "minimal effort" a would be [2, 3] as well.

3) Should there be ahead!3 to allow using a static array as buffer in order to avoid allocation?

4) Should there be support for providing your custom allocator for the runtime flag to allow GC-free behavior?

--
March 02, 2017
https://issues.dlang.org/show_bug.cgi?id=17238

--- Comment #2 from Andrei Alexandrescu <andrei@erdani.com> ---
(In reply to greenify from comment #1)
> A couple of questions to clarify:
> 
> 1) popFront/popBack will move the fixed-size buffer, right? For example:
> 
> 10.iota.ahead(3).drop(2).writeln; // [2, 3, 4]

ahead(k) returns the kth element ahead of front, not a range.

> 2)
> > it embeds a fixed-size buffer and moves through it with minimal effort.
> 
> It's assumed are only shallow which can change?

Affirmative.

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=17238

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P4

--