Hi Raimund
It looks as though parse does an implicit conversion.
This is in Rebol Core 2.6.2
>> parse/all to binary! "abcde" [copy inp to end (print type? inp)]
string
== true
>> oup: parse/all to binary! "abcde" "c"
== ["ab" "de"]
>> type? first oup
== string!
>> oup: parse/all to binary! "abcde" none
== ["abcde"]
>> type? first oup
== string!
and even
>> parse/all #{0000} [copy inp to end (print type? inp)]
string
== true
At the moment, R3 is slightly different as it seems not to perform the
implicit conversion when you supply your own parse rules:
>> parse/all to binary! "abcde" [copy inp to end (print type? inp)]
binary!
== true
>> inp
== #{6162636465}
>> oup: parse to binary! "abcde" none
== ["abcde"]
>> type? first oup
== string!
>> oup: parse #{0000} none
== ["^...@^@"]
>> type? first oup
== string!
Regards
Peter
On 19 Feb 2009, at 02:02, Raimund Dold wrote:
>
> Hi,
>
> thanx this works. But also raises another question for me.
>
> read %lines.txt returns a binary. Why is it possible to omit the to-
> string and
> still get a decent parse result? Is there an implicit to-string?
>
> Raimund
>
> Am Dienstag 17 Februar 2009 schrieb Peter W A Wood:
>> Hi Raimund
>>
>> This should work with text:
>>>> parse/all read %lines.txt newline
>>
>> == ["line 1" "line 2" "line 3" "line 4" "line 5"]
>>
>> Regards
>>
>> Peter
> --
> To unsubscribe from the list, just send an email to
> lists at rebol.com with unsubscribe as the subject.
>
--
To unsubscribe from the list, just send an email to
lists at rebol.com with unsubscribe as the subject.