RFC on SlidingSplitter Range

"Nordlöw" via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Oct 3 13:15:31 PDT 2014


On Friday, 3 October 2014 at 17:46:18 UTC, monarch_dodra wrote:
> I threw this together. I left out checks for infinity in favor 
> of brevity:

Could you please take a look again at

https://github.com/nordlow/justd/blob/master/range_ex.d#L15

I added all the stuff we talked about.

Note that I had to tweak empty() a bit. I don't know if I got 
right. Could you check?

Further I can't get string support to work:

     writefln("%(%s\n%)", slidingSplitter("Nordlöw"));

errors as

std.format.FormatException@/home/per/opt/x86_64-unknown-linux-gnu/dmd/linux/bin64/src/phobos/std/format.d(2591): 
Expected '%s' format specifier for type 'SlidingSplitter!string'

and

     foreach (e; name)
     {
         version(show) writeln(e);
     }

errors as

range_ex.d(132,5): Error: invalid foreach aggregate name, define 
opApply(), range primitives, or use .tupleof

which diagnostics I btw is responsible for :)

Could you please check?


More information about the Digitalmars-d-learn mailing list