[REBOL] Re: Re, Re: Parse problem
From: Izkata::Comcast::net at: 9-Oct-2005 15:09
> Hi Patrick,
>
>>>> to-block "(foo"
> PPln> ** Syntax Error: Missing ) at end-of-script
> PPln> ** Near: (line 1) (foo
>
> PPln> It seems like a bug to me.
>
> Not a bug. REBOL needs to convert the data to valid REBOL values,
> which (foo isn't.
>
> This comes up from time to time, but it's just a distinction we need
> to acknowledge; there are times when we'll need to use string parsing,
> rather than block parsing, even though it's more effort.
There is a (kinda) workaround: (Remembered from a "why does a word have
spaces" question years ago)
>> to-word "(foo"
== (foo
>> X: append [] to-word "(foo"
== [(foo]
>> ? X/1
X/1 is a word of value: (foo
When you just 'to-block (or 'load) the string, Rebol sees the ( and thinks
it's a paren, but if it doesn't matter, or a paren isn't what you want...
Thar ye go!
-Izzy