Words
[1/9] from: gabriele:colellachiara at: 12-May-2006 10:23
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.
--
Gabriele Santilli <gabriele-rebol.com> --- http://www.rebol.com/
Colella Chiara software division --- http://www.colellachiara.com/
[2/9] from: lmecir:mbox:vol:cz at: 12-May-2006 10:43
Gabriele Santilli napsal(a):
> Hello all,
> Given:
<<quoted lines omitted: 42>>
> 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
[3/9] from: lmecir::mbox::vol::cz at: 12-May-2006 10:53
Ladislav Mecir napsal(a):
> Interesting, indeed!
> When doing this from fresh REBOL console, I get:
<<quoted lines omitted: 10>>
> == false
> -L
One more fresh console:
>> alias 'aaa "bbb"
== bbb
>> alias 'aaa "Aaa"
== Aaa
>> equal? 'aaa 'Aaa
== true
And yet another fresh console:
>> equal? 'aaa 'Aaa
== true
>> alias 'aaa "bbb"
== bbb
>> equal? 'aaa 'Aaa
== true
-L
[4/9] from: gabriele::colellachiara::com at: 12-May-2006 14:07
Hi Ladislav,
On Friday, May 12, 2006, 10:43:35 AM, you wrote:
LM> When doing this from fresh REBOL console, I get:
>>> Rebol/version
LM> == 1.3.2.3.1
>>> equal? 'aaa 'Aaa
LM> == true
LM> Now a fresh REBOL console again and:
>>> Rebol/version
LM> == 1.3.2.3.1
>>> alias 'aaa "bbb"
LM> == bbb
>>> equal? 'aaa 'Aaa
LM> == false
So it must be a bug...
Well, bugs aside hope it shows why Pierre J. was wrong.
Regards,
Gabriele.
--
Gabriele Santilli <gabriele-rebol.com> --- http://www.rebol.com/
Colella Chiara software division --- http://www.colellachiara.com/
[5/9] from: gabriele:colellachiara at: 12-May-2006 14:10
Hi Ladislav,
On Friday, May 12, 2006, 10:53:48 AM, you wrote:
LM> One more fresh console:
>>> alias 'aaa "bbb"
LM> == bbb
>>> alias 'aaa "Aaa"
LM> == Aaa
>>> equal? 'aaa 'Aaa
LM> == true
LM> And yet another fresh console:
>>> equal? 'aaa 'Aaa
LM> == true
>>> alias 'aaa "bbb"
LM> == bbb
>>> equal? 'aaa 'Aaa
LM> == true
My suspect is that 'Aaa becomes an alias for 'aaa as soon as it is
parsed, EXCEPT if 'aaa already has aliases.
>> equal? 'aaa 'Aaa
== true
>> equal? 'aaa 'aAa
== true
>> alias 'aaa "bbb"
== bbb
>> equal? 'aaa 'aaA
== false
Very subtle bug, and interesting noone ever had problems because
of this - is anyone really using aliases?
Regards,
Gabriele.
--
Gabriele Santilli <gabriele-rebol.com> --- http://www.rebol.com/
Colella Chiara software division --- http://www.colellachiara.com/
[6/9] from: lmecir:mbox:vol:cz at: 12-May-2006 14:22
Gabriele Santilli napsal(a):
...snip...
> Very subtle bug, and interesting noone ever had problems because
> of this - is anyone really using aliases?
>
> Regards,
> Gabriele.
>
maybe not, I always felt a bit insecure about them. Are you going to put
it to RAMBO or should I?
(I am noticing that you were afraid of using "Aliases" as subject,
weren't you?)
-L
[7/9] from: gabriele:colellachiara at: 12-May-2006 15:11
Hi Ladislav,
On Friday, May 12, 2006, 2:22:57 PM, you wrote:
LM> maybe not, I always felt a bit insecure about them. Are you going to put
LM> it to RAMBO or should I?
I'm adding it.
LM> (I am noticing that you were afraid of using "Aliases" as subject,
LM> weren't you?)
;-)
Just avoiding the wrong thread. But, this bug aside, I hope the
example sheds more light on words in general, and their properties
(e.g. this shows that both "context" and "spelling" are properties
of word values).
Regards,
Gabriele.
--
Gabriele Santilli <gabriele-rebol.com> --- http://www.rebol.com/
Colella Chiara software division --- http://www.colellachiara.com/
[8/9] from: greggirwin:mindspring at: 12-May-2006 8:08
Hi Gabriele,
GS> Very subtle bug, and interesting noone ever had problems because
GS> of this - is anyone really using aliases?
I always thought I would use them for localization purposes,
especially in dialects, but I haven't.
-- Gregg
[9/9] from: lmecir:mbox:vol:cz at: 12-May-2006 16:56
Hi all,
http://www.fm.tul.cz/~ladislav/rebol/contexts.html changed a bit. The
Generalizing BIND
section removed, because the BIND is general enough
in the newest interpreter versions, the "Spelling" and "Aliases"
sections revamped to reflect the results of this thread.
For Gregg: the trick used in the COLLECT function was used in the "Equal
words with different binding" section, where it might have been used
sooner than in http://www.fm.tul.cz/~ladislav/rebol/build-func.r
Error reports appreciated (If you are brave enough to read the article
without being afraid of a psycho-attack the article supposedly caused to
a former member of this ML).
-L
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted