Rebol to-string strange behavior: how can I correct?
-
07-07-2019 - |
Question
>> to-string pick [abc/def] 1
== "abcdef"
>>
How can I get "abc/def" instead ?
Solution
mold pick [abc/def] 1
== "abc/def"
Or:
form pick [abc/def] 1
=="abc/def"
OTHER TIPS
The to-
family of functions were changed in Rebol 3, and your code now provides the string you want. OTOH, form
works in 2 and 3.
Are you using pick [abc/def] 1
because you wanted the literal path abc/def (and not have the interpreter try to pick def out of abc)? You can use quote to get that effect more simply:
>> form quote abc/def
== "abc/def"
And then there's the shorthand:
>> form 'abc/def
== "abc/def"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow