finest-same?
[1/2] from: rotenca::telvia::it at: 16-Feb-2003 10:19
Hi Ladislav,
this is a try to find the finest equality in Rebol. Not checked very much.
Note:
These equalities work only for values referenced by a word
and not only for values referenced by a block - like the indentical? of
Ladislav
identical-w?: func [a [word!] b [word!]][
identical? get/any a get/any b
]
finest-same?: func [a [word!] b [word!]][
if identical-w? a b [
if series? get/any a [return true]
if same-references? a b [return true]
]
false
]
---
Ciao
Romano
[2/2] from: lmecir:mbox:vol:cz at: 17-Feb-2003 16:17
Hi Romano,
<<Romano>>
identical-w?: func [a [word!] b [word!]][
identical? get/any a get/any b
]
finest-same?: func [a [word!] b [word!]][
if identical-w? a b [
if series? get/any a [return true]
if same-references? a b [return true]
]
false
]
<</Romano>>
I think, that your function compares words. An equvivalent rewrite:
finest-same?: func [a [word!] b [word!]] [
found? all [
identical-w? a b
any [
series? get/any a
same-references? a b
]
]
My description of your function:
the function finds two words equivalent, if they both refer to one value and the value
is either a series or both words are same references. The IDENTICAL? equivalence is finer,
any time IDENTICAL? finds two words identical, you will find out, that they are FINEST-SAME?
too.