[REBOL] The Solution of Enigma about Ladislav sameness
From: rotenca:telvia:it at: 29-May-2002 16:17
ATTENTION!
This is the solution of the sameness problem (followed by some comments):
------------------------------------------------
a: #{31}
parse/all a [b:]
------------------------------------------------
The interesting fact is that this is the only case (i know) where the same
data has two different datatype in Rebol.
Said in other words: two different datatypes share the same data.
In the above example, every string you insert in be, will appear "binaryzed"
in a:
insert b "^-^/^@" ;== "1"
a ;== #{090A0031}
The trick works on every any-string datatype: file!, url!, tag!, email!,
image!, issue! (i did not test all of them). An example with file!:
>> a: %1 ;== %1
>> parse/all a [b:] ;== false
>> insert b "^-^/^@" ;== "1"
>> a ;== %%09%0A%001
It could be useful to change the datatype of some data on the fly, without
copying it like the function TO do.
Who find the right solution?
1) Ladislav
2) Gabriele Santilli
---
Ciao
Romano