[Top][All Lists]

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

Re: [Chicken-hackers] [PATCH] Standardize specialization and argument ty

From: Peter Bex
Subject: Re: [Chicken-hackers] [PATCH] Standardize specialization and argument type matching
Date: Fri, 30 Oct 2015 21:15:55 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Oct 01, 2015 at 03:23:34AM +1300, Evan Hanson wrote:
> Hi all,
> Here's a patch implementing a change discussed at ICC[1]: it makes
> argument type matching for specializations behave more intuitively for
> implicit "or" types such as "number" and "boolean". Now, a call will
> trigger a specialization when its types *match, but are not necessarily
> identical* to the specialization's. The same applies to
> compiler-typecase forms. See #1214 and the commit message for more
> details.
> Note that this change requires specifying a precedence rule for
> specializations when more than one is defined for a procedure. The patch
> does the simple thing and uses definition order for this, so that the
> earlier definition wins. (For `compiler-typecase` this is already
> intuitive: it acts like a cond or case form, so the first clause that
> matches is the one that's used).

As always, this code goes way over my head, but the little bit I do
understand looks good, and your explanation sounds like it's doing
the right thing.  Plus, it fixes a bug, adds tests, and simplifies
the code.  What could possibly go wrong?


PS: I noticed there's still an "exact" in over-all-instantiations.
It seems to be called mostly with #t, once with #f and once with "all".
Perhaps it's better to rename that to "all", because that's what it
seems to do: check that all types in the list pass the processor.
Am I correct in my assessment?  What do you think about the change?


Attachment: signature.asc
Description: Digital signature

reply via email to

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