Compute in one pass 3 tokens position
bioinfornatics
bioinfornatics at fedoraproject.org
Mon Apr 30 05:52:08 PDT 2012
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
More information about the Digitalmars-d-learn
mailing list