[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Axiom-developer] defintrf bug
From: |
daly |
Subject: |
[Axiom-developer] defintrf bug |
Date: |
Mon, 9 Jul 2007 13:58:11 -0500 |
Stephen,
(|Record|...) macroexpands into (|Record0|....)
(|:|...) macroexpands into (CONS...)
in OPTPROB.nrlib/code.lsp
(ELT (|Record| (|:| |lfn|
(|List| (|Expression| (|DoubleFloat|))))
(|:| |init| (|List| (|DoubleFloat|)))))
was not expanded. Perhaps we need to do a macroexpand-all?
in DFINTTLS.nrlib/code.lsp, the source line in defintrf.spad, line 90
where
Z ==> Integer
Q ==> Fraction Z
B ==> Boolean
REC ==> Record(left:Q, right:Q)
keeprec? : (Q,REC) -> B
keeprec?(a, rec) == (a > rec.right) or (a < rec.left)
the code used to read:
(|DFINTTLS;keeprec?|
(QCAR (PROG2 (LETT #0# (QREFELT $$ 3) NIL (QCDR #0#)
becomes
(|DFINTTLS;keeprec?|
(QCAR (PROG2 (LETT #0# (QREFELT $$ 1) NIL (QCDR #0#)
I have no idea why the index changed. And in the same file
(|Record|
(|:| (QREFELT $$ 2) (|Fraction| (|Integer|)))
(|:| (QREFELT $$ 1) (|Integer)))
expands to
(|Record0|
(LIST (CONS '|endpoint|
(|Fraction| (|Integer|)))
(CONS '|dir| (|Integer|))))
this seems like a bug in the algebra code to me.
The function keeprec? expects a REC record with left and right indices
but "endpoint" and "dir" are the indices of a REC2:
REC2 ==> Record(endpoint:Q, dir:Z)
so it doesn't seem valid to call keeprec? on a REC2 construct.
Ultimately I think the algorithm is wrong. I think that even though
the signature for keeprec? is properly matched in the call, and the
shape of the record is the same yet the accessor names are wrong.
I'm still checking the other examples and they seem to be expanding
correctly. I'm not sure that your patch is needed.
Tim
- [Axiom-developer] defintrf bug,
daly <=