Hi Scott,
These apparent inconsistencies are not as inconsistent
as they might seem.
First, with "^^", you found the escape character.
In any symbol set you will find "inconsistencies" around
the escape character.
What the above string represents is a single character ^.
It just appears in code that there are two.
The string you need to type can be found by doing this:
to-string first [^^]
but actually, now we remember that ^^ isn't the Rebol
power operator anyway! It's **. Oh well. :-)
Second, you can't inject parenthesis as if they're
words, because they're not words. They are Rebol
syntax at a more fundamental level than words.
(I think that's a correct way to explain it, anyway.)
If you want to create parens, then do it like this:
append copy () something
or
to-paren reduce [some stuff]
It's just the same with blocks and strings.
They are all series! delimiters. " [ ] ( )
You can make the delimiters into words, but then
how are you going to use them?
Regards,
Anton.
Wall, Scott wrote:
> Henrik wrote:
>
>> It will not work, since / can't be directly converted to a word and
>> used as a get-word. The trick would be to write it first as a string
>> and convert it:
>
>> get to-get-word "/"
>
>> That is not very pretty, is it? (But keep it in mind, when you need to
>> convert something unwieldy to a word. :-))
>
> Unfortunately, this approach doesn't seem to work on the "^^" operator.
>>> op: get to-get-word "^^"
> ** Script Error: ^ has no value
> ** Near: op: get to-get-word "^^"
>
> I can however use :power. Shouldn't there be a consistent way to convert
> all operators from string to get-word?
>
> I am also trying to inject parentheses without much success. Is this
> even possible? I've tried:
> x: '(
> x: get to-get-word "("
> x: :(
>
> Each attempt failed.
>
> Thanks,
> Scott.
--
To unsubscribe from the list, just send an email to
lists at rebol.com with unsubscribe as the subject.