|
|
|
last edited 17 years ago by gdr |
| 1 2 | ||
|
Editor: kratt6
Time: 2008/01/07 06:11:30 GMT-8 |
||
| Note: | ||
changed: - The expected result is false, but: \begin{axiom} R ==> Record(key: Symbol, entry: String) T ==> AssociationList(Symbol, String) t1 := construct([[x, "ix"]$R])$T t2 := construct([[y, "iy"]$R])$T (t1=t2)::Boolean \end{axiom} 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
The expected result is false, but:
axiomR ==> Record(key: Symbol, entry: String)
axiomT ==> AssociationList(Symbol, String)
axiomt1 := construct([[x, "ix"]$R])$T
| (1) |
axiomt2 := construct([[y, "iy"]$R])$T
| (2) |
axiom(t1=t2)::Boolean
| (3) |
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