On Monday, 30 April 2012 at 12:53:16 UTC, bioinfornatics wrote:
Hi,
I would like to know how compute in on pass 3 tokens position in a
sequence.
curently i do:
File f = File( "reader.d", "r" );
scope(exit) f.close();
char[1024] buffer;
char[] content = f.rawRead(buffer);
char[sizediff_t] token = ['(', '{', ';'];
auto position = map!( a => content.countUntil( a ) )( [ ['('], ['{'],
[';'] ] );


if i use reduce instead map the build fail

It doesn't give your answer directly, but I requested that countUntil take ranges:

http://d.puremagic.com/issues/show_bug.cgi?id=5507

And made such a countUntil so that I could use it:

https://github.com/JesseKPhillips/JPDLibs/blob/csvoptimize/csv/newadds.d

Reply via email to