[REBOL] Re: Words
From: lmecir:mbox:vol:cz at: 12-May-2006 10:43
Gabriele Santilli napsal(a):
> Hello all,
>
> Given:
>
> check: func [n m] [
> print ["Considering" block/:n "and" block/:m "(positions" n "and" m "in the block):"]
> either same? block/:n block/:m [
> print "they are the same word"
> ] [
> either equal? block/:n block/:m [
> print "they are not the same word, but they are equal"
> ] [
> print "they are not equal"
> ]
> ]
> ]
>
> we have:
>
>>> alias 'aaa "bbb"
>>>
> == bbb
>
>>> block: [aaa bbb aaa Aaa]
>>>
> == [aaa bbb aaa Aaa]
>
>>> append block use [aaa] ['aaa]
>>>
> == [aaa bbb aaa Aaa aaa]
>
>>> check 1 2
>>>
> Considering aaa and bbb (positions 1 and 2 in the block):
> they are not the same word, but they are equal
>
>>> check 1 3
>>>
> Considering aaa and aaa (positions 1 and 3 in the block):
> they are the same word
>
>>> check 1 4
>>>
> Considering aaa and Aaa (positions 1 and 4 in the block):
> they are not equal
>
>>> check 1 5
>>>
> Considering aaa and aaa (positions 1 and 5 in the block):
> they are not the same word, but they are equal
>
>>> check 2 4
>>>
> Considering bbb and Aaa (positions 2 and 4 in the block):
> they are not equal
>
> Regards,
> Gabriele.
>
Interesting, indeed!
When doing this from fresh REBOL console, I get:
>> Rebol/version
== 1.3.2.3.1
>> equal? 'aaa 'Aaa
== true
Now a fresh REBOL console again and:
>> Rebol/version
== 1.3.2.3.1
>> alias 'aaa "bbb"
== bbb
>> equal? 'aaa 'Aaa
== false
-L