Hi Stas,

On Sat, Jan 24, 2015 at 8:42 AM, Stanislav Malyshev <smalys...@gmail.com>
wrote:

> > The only reasonable behavior for <==>, <==, >== would be raising
> > error/exception if type differs.
> > E_RECOVERABLE_ERROR may be used.
>
> Comparison operators raising exceptions doesn't sound like a very nice
> thing to work with.


I meant if it's ever implemented.
DbC would do the job to prevent/detect illegal comparison and it's much
better
than catching errors in comparison. IMHO.

Type hint is useful for preventing/detecting illegal comparisons also.
There are many
cases that types are better to be checked always. However, there are many
cases that
type checks are better to be omitted for production code also. DbC can be
use in this case
for faster execution while asserting types during development.

Anyway, it's off topic.

Regards,

--
Yasuo Ohgaki
yohg...@ohgaki.net

Reply via email to