login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Submitted by : kratt6 at: 2008-01-07T06:11:30-08:00 (16 years ago)
Name :
Axiom Version :
Category : Severity : Status :
Optional subject :  
Optional comment :

The expected result is false, but:

axiom
R ==> Record(key: Symbol, entry: String)
Type: Void
axiom
T ==> AssociationList(Symbol, String)
Type: Void
axiom
t1 := construct([[x, "ix"]$R])$T

\label{eq1} \mbox{\rm table} \left({x = \mbox{\tt "ix"}}\right)(1)
Type: AssociationList?(Symbol,String)
axiom
t2 := construct([[y, "iy"]$R])$T

\label{eq2} \mbox{\rm table} \left({y = \mbox{\tt "iy"}}\right)(2)
Type: AssociationList?(Symbol,String)
axiom
(t1=t2)::Boolean

\label{eq3} \mbox{\rm false} (3)
Type: Boolean

The reason is in the definition of equality in 'TBAGG':

       s:% = t:% ==
       eq?(s,t) => true
       #s ^= #t => false
       for k in keys s repeat
         (e := search(k, t)) case "failed" or (e::Entry) ^= s.k => false
       true

which will always return true. One should insert a "return" between => and false.

Martin

Fixed in OpenAxiom




  Subject:   Be Bold !!
  ( 15 subscribers )  
Please rate this page: