[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-hackers] [PATCH] Standardize specialization and argument type m
From: |
Evan Hanson |
Subject: |
[Chicken-hackers] [PATCH] Standardize specialization and argument type matching |
Date: |
Thu, 1 Oct 2015 03:23:34 +1300 |
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).
Separate patches for master and chicken-5 are attached.
Cheers,
Evan
[1]: Of course, I have to mention how great it was to finally meet
everyone. Huge thanks to all involved.
0001-Standardize-specialization-and-argument-type-matchin.master.patch
Description: Text Data
0001-Standardize-specialization-and-argument-type-matchin.chicken-5.patch
Description: Text Data