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.

----- Original Message -----
From: "Ged Byrne" <[EMAIL PROTECTED]>
To: "Rebol" <[EMAIL PROTECTED]>
Sent: Tuesday, November 11, 2003 12:02 PM
Subject: [REBOL] Working with tags


>
> I'm just having a little bit of trouble with tags, and
> I can't find what I'm after in the docs.
>
> I'm using the following expressions:
>
> fp: []
> text: "This is text"
> append fp rejoin [<tag> text </tag>]
>
> The result is:
> <tagThis is text</tag>>
>
> I wanted:
> <tag>This is text</tag>
>
> If I try:
> append fp [<tag> text </tag>]
>
> I get:
> <tag> text </tag>
>
> If I try:
> append fp reduce [<tag> text </tag>]
>
> I get:
> <tag> "This is text" </tag>
>
> Which is oh so close, but I don't want them quotes in!
>
> To infuriate me further print [<tag> text </tag>]
> displays the desired results.
>
> Where am I going wrong?
>
> What expression should I be using?
>
>
>
> ________________________________________________________________________
> Want to chat instantly with your online friends?  Get the FREE Yahoo!
> Messenger http://mail.messenger.yahoo.co.uk
> --
> To unsubscribe from this list, just send an email to
> [EMAIL PROTECTED] with unsubscribe as the subject.
>
>

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.

Reply via email to