Re: problem with reduce on array of Tuples

2010-05-27 Thread Pelle
This has nothing to do with the tuples, I think. test2.d: import std.algorithm; void main() { map!((int x){return x+1;})([1,2,3,4,5]); } pp ~/dee% rdmd test2.d test2.d(4): Error: delegate std.algorithm.__dgliteral1 cannot access frame of function __dgliteral1 test2.d(4): Error: template

problem with reduce on array of Tuples

2010-05-27 Thread Adrian Matoga
The following code fails to compile: double sim(Document doc, string query) { alias Tuple!(double, "wij", double, "wiq") Weights; Document q = Document.fromString(query); Weights[] wi; foreach (s; StrFilt(query)) wi ~= Weights(doc.termFreq(s) * i