metaeducation / rebol-issues

6 stars 1 forks source link

Object! structural equality not working with percent! or money! #1133

Open rebolbot opened 15 years ago

rebolbot commented 15 years ago

Submitted by: Ladislav

The test below yields False, and according to the informations from Brian, it is expected to yield True?

>> equal? 1 1.0
== true
>> equal? construct [c: 1] construct [c: 1.0]
== true
>> equal? 1 $1
== true
>> equal? construct [c: 1] construct [c: $1]
== false  ; should be true
>> equal? 1 100%
== true
>> equal? construct [c: 1] construct [c: 100%]
== false  ; should be true
; and so on

CC - Data [ Version: alpha 76 Type: Bug Platform: All Category: Native Reproduce: Always Fixed-in:none ]

rebolbot commented 15 years ago

Submitted by: BrianH

Basically, if two values are EQUAL?, then those values should be EQUAL? as object fields. The same goes for EQUIV? and STRICT-EQUAL?. SAME? shouldn't do structural equivalence.

Example code adjusted accordingly, and ticket changed to a bug.

rebolbot commented 14 years ago

Submitted by: Ladislav

in the core-tests suite
hostilefork commented 6 years ago

Here is Ladislav's complex failing test, lifted from the test suite:

a-value: make object! [
    a: 1 b: 1.0 c: $1 d: 1%
    e: [a 'a :a a: /a #"a" #{00}]
    f: ["a" #a http://a a@a.com <a>]
    g: :a/b/(c: 'd/e/f)/(b/d: [:f/g h/i])
]
b-value: make object! [
    a: 1.0 b: $1 c: 100% d: 0.01
    e: [/a a 'a :a a: #"A" #[binary! #{0000} 2]]
    f: [#a <A> http://A a@A.com "A"]
    g: :a/b/(c: 'd/e/f)/(b/d: [:f/g h/i])
]
equal? a-value b-value