Spelling has nothing to do with whether one word is an alias for
another word.
For one word to be an alias for another, during some point in
the past, the use of ALIAS must have occurred, e.g.,

>> alias 'func "def"
== def
>> ;setting 'def as alias for 'func just occurred. it's now in
the past

At some later point, to test if such an occurrence occurred, we
need to make a case for tests.

We want to be sure that 

1) no matter how many times we feed input to aliases?, aliases
produces the correct output
2) no matter what sequence we feed input to aliases?, aliases
produces the correct output

>> aliases? 'def 'func
== true
>> aliases? 'func 'def
== true

>> aliases? 'daft 'func
== false

The question rests on one query -- 

"When is one word an alias for another word?" 

In other words --

Did the use of ALIAS 'word "alias" occur?

Your test is simply false. Spelling has nothing to do with it.

-----------------------------------------------------------------------------
mercir-aliases?: func [
    {find out, if word1 and word2 are aliases}
    word1 [any-word!]
    word2 [any-word!]
] [
    found? all [
        equal? :word1 :word2
        not equal? spelling :word1 spelling :word2
    ]
]

which depends upon:

mercir-spelling: func [
    {return the spelling of a word}
    word [any-word!]
] [
    if word? :word [return mold word]
    if set-word? :word [return head remove back tail mold :word]
    next mold :word
]
-------------------------------------------------------------------------------------
To obtain an answer to (Did the use of ALIAS 'word "alias"
occur?), we need to know how the writers of REBOL decided how to
track such an occurrence.

And here it is:

Two words are aliases if and only if their definitionals
("values") are equal AND they point to the exact same (one and
only one) definitional ("value") existing within REBOL
controlled memory.

The correct expression of this test has its basis here and here
alone:

aliases?: debate [
        word1 [any-word!]
        word2 [any-word!]
        ][
        either (not same? word1 word2) and (equal? word1 word2) [
                true
        ][      
                false
        ]
 ]
   
Your definitional produces a result, that is not in dispute, but
the result even if it reflects truth, isn't truth. It's a mirror
only; one with a trapped image inside wishing only to be alive
with truth existence, not mirrored existence.
  
The real culprit is here [
http://www.rebol.com/docs/words/walias.html ] and the incorrect
claim, 

"Summary:
Creates an alternate spelling for a word "

ALIAS does no such thing. ALIAS establishes singular existence
for two words -- sets two words to the exact same (one and only
one) definitional ("value") existing within REBOL controlled
memory, which makes them equal.

For ALIAS to work, ALIAS requires 

1) an already existing definitional 
2) an alternative spelling of an already existing word that
labels such definitional

What makes ALIAS different from set-word: :get-word is simply
this -- 

One word is not a pointer to another word here. Both words point
to the only existing definitional!

Pier





________________________________________________
Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag
-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to