Hi Robert,
you wrote:
[...]
>test: 'h1s
>== h1s
[...]
>So far so good. Now comes the problem:
>
>>> test: to-lit-word "h1s"
>== 'h1s
>Why this?
You can see it yourself. Compare the response of REBOL when you literally
assign the literal h1s to test:
== h1s
vs. when you programmatically assign a literal h1s to test:
== 'h1s
Your literal assignment is first processed by the REBOL interpreter. It
evaluates the literal hls (tick h1s) and returns the word hls, which is
assigned to the word test. In your second attempt the REBOL interpreter
does not evaluate the literal h1s you are creating programmatically:
to-lit-word "h1s"
instead the literal h1s, `h1s is assigned to test as its value.
So in the first example test is referencing the value h1s, a type word; in
your second example test is referencing `h1s, a type literal word:
1. Literal Word:
>> test: 'h1s
== h1s
>> type? :test
== word!
2. Programmatic Literal Word:
>> test: to-lit-word "h1s"
== 'h1s
>> type? :test
== lit-word!
Instead use:
3. Programmatic Word:
>> test: to-word "h1s"
== h1s
>> probe HSA/:test
make object! [
pre: []
post: []
level: 1
]
Hope this helps
;- Elan >> [: - )]