REBOL 3.0

Conversions to string!

Carl Sassenrath, CTO
REBOL Technologies
27-Jun-2007 15:58 GMT

Article #0092
Main page || Index || Prior Article [0091] || Next Article [0093] || 17 Comments || Send feedback

REBOL has fairly complex rules for conversions to string. For example, it assumes that an issue, #abc should format without the # but money, $1.23 should always display the $.

It does not seem consistent. The reason: it was optimized for usability in the common cases. But, in R3, it may be time to change the rules.

Perhaps the question can be reduced to simply this: do we want to-string! to not add the datatype formatting?

As a clear example:

>> to string! 1
== "1"
>> to string! $1
== "$1.00"

Should we change that?

>> to string! $1
== "1"

What we need is to create a table of conversions and examine each one to decide what is best. [I could use some help on that, because my time is so restricted with R3 coding.]

Keep in mind that these converters are available:

 to-stringlow level conversion to a string
 formhigh level conversion to string
 formatconversion with specification (new in R3, but more to do)
 moldconversion to REBOL source format

17 Comments

REBOL 3.0
Updated 29-Apr-2017 - Edit - Copyright REBOL Technologies - REBOL.net