[REBOL] Re: Working with tags
From: brett:codeconscious at: 11-Nov-2003 12:28
An oldie but a goodie :-)
A Tag! is a type of String! just written differently.
Ie instead of "tag" you write <tag>
Rejoin uses Append
See what happens when you append to a tag:
>> append <body> { bgcolor="green"}
== <body bgcolor="green">
That's they "why" of it.
The how of it...What you wanted was a string result. One approach:
text: "This is text"
reform [<tag> text <tag>]
Another (different result):
rejoin [{} <tag> text <tag>]
The second one works because the second, third and fourth items in the block
are appended to the string giving the right datatype. Compare with:
rejoin [[] <tag> text <tag>]
...which you wouldn't use (reduce would be simpler).
Regards,
Brett.