Thanks, Charles. I'll update and give it a shot.
If I wanted to take a stab at making "in" work the way I want, would I look at 'class InExpr' in 'Source/BinaryOpExpr.cobra' and/or 'Source/Cobra.Lang/Native.cs'?
Forums
cue equals
14 posts
• Page 2 of 2 • 1, 2
Re: cue equals
IIRC correctly, InExpr is going to use the .NET Contains() method of the list which in turn is not going to use the strongly typed .equals.
Two approaches I can think to fixing this are modifying InExpr as you've indicated here, or implementing a "cue equals" that produces the Object.equals method as a side effect.
Two approaches I can think to fixing this are modifying InExpr as you've indicated here, or implementing a "cue equals" that produces the Object.equals method as a side effect.
- Charles
- Posts: 2515
- Location: Los Angeles, CA
Re: cue equals
Yesterday, I finally got a chance to test the latest changes in regards to equality testing and everything seems to be working quite nicely. After reading some docs on MSDN I also found that as long as my class implements the IEquatable<of T> interface, then the "in" operator will call the strongly typed equals as expected. Thanks again, Charles!
- nerdzero
- Posts: 286
- Location: Chicago, IL
14 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 21 guests