|
From: | Paul F. Dietz |
Subject: | Re: [Gcl-devel] Calling for top ten ANSI issues ... |
Date: | Mon, 22 Sep 2003 16:27:06 -0500 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 |
Camm Maguire wrote:
OK, I've put in code (not yet committed) in subtypep to coerce symbols to the class they may name if possible, and resolve the subtype relationship according to the class precedence list, i.e. just as subtypep handles class object arguments at present. A few type/class questions: 1) I'm assuming from what I read that the above logic is valid. 2) I'm assuming that there is no analogous logic I can use to process subtypep relationships between instances of classes 3) Our subtypep function really needs help. Its mostly a list of one-off relationships at present. Do you know of a more elegant algorithm, likely recursive, to handle non-class type relationships in subtypep in a more robust fashion?
Getting SUBTYPEP to work well was a lot of work for the SBCL/CMUCL developers (the test cases showed up lots of problems there.) Baker has an algorithm from the early 1990s that does well, *except* on CONS types (where it can take exponential time; the compound CONS type was added to the Common Lisp standard shortly after Baker wrote this paper.) ECL uses this algorithm. The exponential cases all have and/or/not in them somewhere, though, so it's ok to give up when you see those. This is an area where standards compliance allows the implementation to get away with doing very little. There are many tests in the test suite on subtypep that can be passed by either successfully computing the subtypep relationship or by failing (returning NIL NIL). Paul
[Prev in Thread] | Current Thread | [Next in Thread] |