bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Short circuiting behaviour in type specific equality predicates


From: Andy Wingo
Subject: Re: Short circuiting behaviour in type specific equality predicates
Date: Thu, 28 Apr 2011 12:50:50 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

On Sun 03 Apr 2011 22:43, Ian Price <address@hidden> writes:

> scheme@(guile-user)> (= 9 10 "foo")
> $1 = #f
[...]

> I was not sure whether or not to report this, as the behaviour is VERY
> consistent and therefore, I thought, likely to have been a conscious
> design choice.

Amusingly, I don't think it was a conscious decision, despite the
consistency.

> If this is the case, you can ignore this, but it seems to me that the
> reason for having type specific equality predicates is because 1. I
> want the guarantee or 2. It could theoretically help the bytecode
> compiler give better code.

I would not be against some compile-time warning passes to check that
the arguments are of the right type, but at least for things like <
there's the possibility of goops extending the primitives to be generic,
so that e.g "bar" could be less than "foo".  So producing a warning, or
indeed, even doing a typecheck, is tricky.

Thank you for investigating this issue, but unless someone feels very
strongly about it, I am inclined to punt :)

Regards,

Andy
-- 
http://wingolog.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]