[REBOL] Re: Read question in Reb 3.0
From: pwawood::gmail::com at: 19-Feb-2009 9:06
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: