Re: Compute in one pass 3 tokens position

2012-05-04 Thread Jesse Phillips
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

Re: Compute in one pass 3 tokens position

2012-05-03 Thread bioinfornatics
Le lundi 30 avril 2012 à 14:52 +0200, bioinfornatics a écrit : > 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[sized

Re: Compute in one pass 3 tokens position

2012-05-03 Thread bioinfornatics
Le lundi 30 avril 2012 à 14:52 +0200, bioinfornatics a écrit : > 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[sized

Re: Compute in one pass 3 tokens position

2012-04-30 Thread Era Scarecrow
On Tuesday, 1 May 2012 at 02:49:19 UTC, bioinfornatics wrote: Le lundi 30 avril 2012 à 14:52 +0200, bioinfornatics a écrit : Anyone know how to know the position of 3 token in one sequence in one pass? tok1 = a tok2 = b tok3 = c seq = blah count me b=> 0 a=>2 c=>5 iterate over sequence if tok

Re: Compute in one pass 3 tokens position

2012-04-30 Thread bioinfornatics
Le lundi 30 avril 2012 à 14:52 +0200, bioinfornatics a écrit : > 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[sized

Compute in one pass 3 tokens position

2012-04-30 Thread bioinfornatics
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