Please do not reply to this email- if you want to comment on the bug, go to the URL shown below and enter your comments there.
Changed by [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=81351 --- shadow/81351 2007-04-10 20:40:58.000000000 -0400 +++ shadow/81351.tmp.15144 2007-04-10 20:40:58.000000000 -0400 @@ -0,0 +1,63 @@ +Bug#: 81351 +Product: Mono: Compilers +Version: 1.2 +OS: +OS Details: +Status: NEW +Resolution: +Severity: +Priority: Wishlist +Component: C# +AssignedTo: [EMAIL PROTECTED] +ReportedBy: [EMAIL PROTECTED] +QAContact: [EMAIL PROTECTED] +TargetMilestone: --- +URL: +Cc: +Summary: linq except method flawed + +I cannot find official documentation of the linq methods (if anyone could +point me to them i'd be much obliged), but the following just seems plain +wrong to me: + +first:0 1 2 3 4 5 6 7 8 9 +second:4 5 6 10 +first.except(second):0 1 2 3 7 8 9 10 + +(if you look at the source of except you'll see that it doesn't do some +sort of xor either, it's weirder) + +program to reproduce: + +using System; +using System.Linq; +using System.Collections.Generic; + +public class Bla { + public static void Main() { + int[] first = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; + int[] second = new int[] { 4, 5, 6, 10 }; + + IEnumerable<int> q = first.Except(second); + + Console.Write("first:"); + foreach (int num in first) Console.Write(num+" "); + Console.WriteLine(); + Console.Write("second:"); + foreach (int num in second) Console.Write(num+" "); + Console.WriteLine(); + Console.Write("first.except(second):"); + foreach (int num in q) Console.Write(num+" "); + Console.WriteLine(); + + } +} + +There's a pseudocode algorithm on hooked on linq: +http://www.hookedonlinq.com/ExceptOperator.ashx + +I'm also willing to implement it, but i have no idea about procedures etc +(that is, i'm willing to code, but atm don't have time to do all the +politics, if someone emails me i'm perfectly willing to write working code). + +Also, shouldn't there be unit tests for these functions? _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
