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:(9)

From: larry:ecotope at: 3-Oct-2000 18:24

Hi Carl
> >yeah, REBOLs build-in binary capabilities are a bit strange sometimes :-/ > >## to binary! 100 > >== #{313030} > > Doesn't that seem like a bug? >
Yes, now that you mention it, this has bothered me all along. It is often frustrating that to-binary returns the ascii bytes of the string representation of integers and decimals. It would be useful and logical if to-binary actually returned the IEEE754 representations for integer and decimal arguments. This would be very helpful for those few of us who are interested in using REBOL for engineering and scientific numeric work. Possibly things are the way they are because the binary type is an any-string. I guess the internal representation for the data of a binary is just the same sequence of bytes as a string. Consider
>> to-string to-binary 100
== "100"
>> to-binary 100
== #{313030}
>> to-binary to-string #{313030}
== #{313030}
>> to-string #{313030}
== "100" In other words, to-binary and to-string are mutually inverse operations. They just show different ways of looking at the same underlying byte sequence. Cheers -Larry