[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gcl-devel] Current state of the ansi test suite
From: |
Camm Maguire |
Subject: |
Re: [Gcl-devel] Current state of the ansi test suite |
Date: |
01 Oct 2002 00:52:11 -0400 |
Greetings! I've committed changes bringing the (known) errors down to
17. So there! :-) My solutions are ugly in places and in need of
comment from more experienced lispers.
1) I added code to ensure that the order of the arguments to certain
test functions was preserved, clearing the set-exclusive-or bit. I
defined a new keyword :rev, which is interpreted by the internal
function member1. I was worried about making set-difference accept
this key, as it is an official function, so I defined alternates
like so and used them appropriately:
+(defun set-difference-rev (list1 list2 &rest rest &aux ans)
+ (do ((x list1 (cdr x)))
+ ((null x) (return ans))
+ (or (consp x) (error "SET-DIFFERENCE not passed a list"))
+ (if (not (apply #'member1 (car x) list2 :rev t rest))
+ (setq ans (cons (car x) ans)))) )
(defun set-exclusive-or (list1 list2 &rest rest &key test test-not key)
(declare (ignore test test-not key))
(nconc (apply #'set-difference list1 list2 rest)
- (apply #'set-difference list2 list1 rest)))
+ (apply #'set-difference-rev list2 list1 rest)))
Pretty ugly.
2) I defined a new error function, specific-error, to allow passing
certain error types from lisp as opposed to C. The conditions
system (kcl-cond.lisp) hashes the type keyword *and the error
format string* as a joint key handling the error type and some
other data. Unless the clcs-universal-error-handler is passed the
precise format string matching the error type keyword, the hash
lookup will fail and a simple error will be triggered. So
specific-error must be called like this:
- (if (and (eq 'null (car type)) (not (equal size 0)))
- (error "Cannot make 'null sequence of size ~S." size))
+ (if (or (and (eq 'null (car type)) (not (equal size 0)))
+ (and (eq 'cons (car type)) (equal size 0)))
+ (specific-error :wrong-type-argument "~S is not of type
~S."
+ type (format nil "list (size ~S)" size)))
pretty ugly.
3) I don't know why both member and member1 are needed --the latter is
the former with an extra call to the key function on the item.
Should member ever be called using the key only on the list?
@(defun member (item list &key test test_not key)
saveTEST;
@
protectTEST;
setupTEST(item, test, test_not, key);
while (!endp_prop(list)) {
if (TEST(list->c.c_car))
goto L;
list = list->c.c_cdr;
}
restoreTEST;
@(return list)
@)
@(defun member1 (item list &key test test_not key rev)
saveTEST;
@
protectTEST;
if (key != Cnil)
item = ifuncall1(key, item);
if (rev != Cnil)
reverse_comparison=1;
setupTEST(item, test, test_not, key);
while (!endp(list)) {
if (TEST(list->c.c_car))
goto L;
list = list->c.c_cdr;
}
restoreTEST;
reverse_comparison=0;
@(return list)
@)
4) Is it ok to
a) add implementation specific keywords like :rev
b) change the hashing in clcs-universal-error-handler to use
only the error name as key?
Take care,
"Paul F. Dietz" <address@hidden> writes:
> Camm Maguire wrote:
> >
> > greetings again!
> >
> > "Paul F. Dietz" <address@hidden> writes:
> >
> > > Currently, 52 tests are failing:
> > >
> > > 52 out of 2499 total tests failed: LAST-11, LAST-12, LAST-13, LAST-14,
> > > LAST-15, LDIFF-5, TAILP-4,
> >
> > Chcking in changes which brings this down to 36. Please verify.
>
> Verified, but note I've added some tests so the number of failures
> is up to 46. The ten new failures are related to :KEY NIL arguments
> to various remove/delete functions.
>
> Paul
>
>
--
Camm Maguire address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens." -- Baha'u'llah
- Re: [Gcl-devel] Current state of the ansi test suite,
Camm Maguire <=