Re: ? 1={}, is there really any other interpretation?
- Posted by Pete Lomax <petelomax at ?lueyonder.co.uk> Jul 15, 2007
- 687 views
Jason Gade wrote: > > Hey, now! That's not nice! ;) Sorry, I was't specifically referring to you, I was busy insulting lots of other people > > If you read the thread you can see that I've since amended my opinion on that. Congratulations! You are not in the group I consider fools > > I've never needed to use compare() hence my unfamiliarity with its basics. OK, the point you may miss is that legacy code is generally littered with places where the author has replaced "=" with "equal" and "<" etc with "compare" precisely because a boolean result is needed at that point. Hence equal() and compare() should be left well alone even if the behaviour of =, !=, <, etc is changed, instead add say sq_eq(), sq_ne() etc to replace any missing functionality. There could also be additional parameters to or variants of sq_eq() etc which determine nesting level, action to take if lengths do not match, etc. An alternative scheme is to add eg "@=", "@!=", etc infix operators which explicitly signal, both to the compiler and a human reading the code, that the "deep compare" variant is needed. Regards, Pete