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

[REBOL] Re: make string!

From: joel:neely:fedex at: 26-Jun-2001 14:45

Hi, Ryan, [ryan--christiansen--intellisol--com] wrote:
> Try as I might, I am unable to make an integer! value into a > string! value, EXCEPT when I use 'append to append the > integer! value to a string! value. > Why can 'append take care of changing the datatype while make > string! cannot? For example: > > >> a: 2 > == 2 > >> b: make string! a > == "" >
The meaning of make string! 2 (with anything that evaluates to 2 in that last position, *including* a word set to 2) is to ask REBOL to create a new string with enough space "pre-allocated" to hold 2 characters before having to grab more space. If you want to convert an integer to a string, try any of
>> a: 234 == 234 >> to-string a == "234" >> mold a == "234" >> form a == "234"
or the truly baroque ;-)
>> make string! reduce [a] == "234"
HTH! -jn- -- ------------------------------------------------------------ Programming languages: compact, powerful, simple ... Pick any two! joel'dot'neely'at'fedex'dot'com