[Mono-bugs] [Bug 81351][Wis] New - linq except method flawed
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Tue Apr 10 20:40:58 EDT 2007
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 ijbema at fmf.nl.
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: rharinath at novell.com
+ReportedBy: ijbema at fmf.nl
+QAContact: mono-bugs at ximian.com
+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?
More information about the mono-bugs
mailing list