digitalmars.D.learn - Range tee()?
- Nick Sabalausky (Abscissa) (22/22) Oct 16 2017 Does Phobos have a way to "tee" a range?
- lobo (3/6) Oct 16 2017 https://dlang.org/phobos/std_range.html#tee ?
- Nick Sabalausky (Abscissa) (3/12) Oct 16 2017 Ahh, thanks, I was only looking in std.algorithm. Didn't expect it to be...
- Adam D. Ruppe (5/6) Oct 16 2017 use my dpldocs search engine
Does Phobos have a way to "tee" a range? For example, suppose you had something like this: ------------------------------------------------- // Do something with each file in a dir dirEntries(selectedDir, SpanMode.shallow) .filter!someFilterCriteria .doSomethingWithFile; ------------------------------------------------- It would be really nice to be able to "wiretap" that, to trace/debug/etc by nothing more than ADDING a single statement at any desired wiretap point: ------------------------------------------------- // Do something with each file in a dir dirEntries(selectedDir, SpanMode.shallow) //.tee(a => writeln("FOUND: ", a)) // DEBUG: TRACE ALL FILES FOUND! .filter!someFilterCriteria //.tee(a => writeln("SELECTED: ", a)) // DEBUG: TRACE RESULT OF FILTER! .doSomethingWithFile; ------------------------------------------------- Does something like this already exist Phobos? I tried looking for a "tee" in st.algorithm but came up nothing. If not, it seems like a pretty glaring omission.
Oct 16 2017
On Monday, 16 October 2017 at 07:28:03 UTC, Nick Sabalausky (Abscissa) wrote:Does Phobos have a way to "tee" a range? For example, suppose you had something like this: [...]https://dlang.org/phobos/std_range.html#tee ?
Oct 16 2017
On 10/16/2017 03:30 AM, lobo wrote:On Monday, 16 October 2017 at 07:28:03 UTC, Nick Sabalausky (Abscissa) wrote:Ahh, thanks, I was only looking in std.algorithm. Didn't expect it to be in std.range.Does Phobos have a way to "tee" a range? For example, suppose you had something like this: [...]https://dlang.org/phobos/std_range.html#tee ?
Oct 16 2017
On Monday, 16 October 2017 at 07:28:03 UTC, Nick Sabalausky (Abscissa) wrote:Does Phobos have a way to "tee" a range?use my dpldocs search engine http://dpldocs.info/tee std.range pops right up!
Oct 16 2017