One case of careless opDispatch :)

2010-07-15 Thread Dmitry Olshansky
As a practical habit, once I stumble upon a very tricky error, I usually share the valuable knowledge of "when you do this ... and get that ... it's probably because ... " Damn, sometimes they can even become cool quizzes... So to warn those oblivious to the dangers of opDispatch, here is my the

Re: One case of careless opDispatch :)

2010-07-15 Thread Robert Jacques
On Thu, 15 Jul 2010 15:34:23 -0400, Dmitry Olshansky wrote: As a practical habit, once I stumble upon a very tricky error, I usually share the valuable knowledge of "when you do this ... and get that ... it's probably because ... " Damn, sometimes they can even become cool quizzes... So t

Re: One case of careless opDispatch :)

2010-07-15 Thread Nick Sabalausky
"Dmitry Olshansky" wrote in message news:i1nns8$d4...@digitalmars.com... > > The tricky part is that *any* class with unconstrained (or loosely > constrained) opDispatch is also a Range, and at least a bidirectional one, > since it "provides" all the primitives: front, popFront etc. > In fact s

Re: One case of careless opDispatch :)

2010-07-23 Thread Tomek Sowiński
Dnia 15-07-2010 o 21:52:56 Robert Jacques napisał(a): I've run into this before, with other compile-time tests such as isAssociativeArray. Often, the real bug is the tests themselves are too permissive. Yes. I think isSomeRange should check that pop(Front|Back) returns void. opDispatch