Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Problem with try [ open/direct/binary tcp://... ] Re:

From: kgd03011:nifty:ne:jp at: 5-Oct-2000 1:15

Hi Elan, Thanks for setting me straight on where my observations were lacking. So, apparently INSERT and friends always use TO STRING! , but TO STRING! 's behavior itself is a little harder to understand than I'd thought. I take it that of the three types of conversion, MOLD preserves the integrity of the original value the most, TO STRING! compromises it the most, and FORM is somewhere in between. TO STRING! wipes out the distinction between the members of any block values it gets, but preserves the internal integrity of individual members of its block value arguments. This produces these results, which were unexpected for me:
>> to string! [abc/def/ghi jkl/mno/pqr]
== "abc/def/ghijkl/mno/pqr"
>> to string! [["abc" "def" "ghi"] ["jkl" "mno" "pqr"]]
== "abc def ghijkl mno pqr" I'd like to know if Carl thinks this behavior is a bug as well. You say,
>5. I think it is reasonable to expect that REBOL's conversion routines >maintain CONVERSION INTEGRITY. Unfortunately that is not true. Examples:
I was thinking that CONVERSION INTEGRITY was the job of MOLD, which saves the most integrity. But even that doesn't give quite the right answer sometimes:
>> to block! mold ["abc" "def"]
== [["abc" "def"]] although LOAD works OK for this case:
>> load mold ["abc" "def"]
== ["abc" "def"] I think CONVERSION INTEGRITY can be achieved in most cases, but you have to use a heterogenous set of tools on a case-by-case basis. Not an ideal situation! And it seems there's no way to maintain CONVERSION INTEGRITY with datatype!
>> to datatype! to string! string!
** Script Error: Cannot use to on datatype! value. ** Where: to datatype! to string! string!
>> load mold string!
== string!
>> type? load mold string!
== word! Eric