REBOL 3 Docs Guide Concepts Functions Datatypes Errors
  TOC < Back Next >   Updated: 4-Aug-2010 Edit History  

REBOL 3 Functions: ajoin

ajoin  block

Reduces and joins a block of values into a new string.


block [block!]

See also:

join   rejoin   form   reform   append  


The join and rejoin functions return the same datatype as their first element, be it a string!, file!, binary!, tag!, email! or whatever. However, there are times when you just want to construct a string!, and that's the purpose of ajoin.

For example:

ajoin ["test" 123]

It is similar to reform but does not insert spaces between values:

reform ["test" 123]
"test 123"

Note that the block is always evaluated:

time: 10:30
ajoin [time/hour "h" time/minute "m"]

The ajoin function is equivalent to:

to-string reduce block

How it differs

Here are examples that show how ajoin differs from join and rejoin.


ajoin [<test> 123]


rejoin [<test> 123]


join <test> 123

Notice that the last two examples return a tag!, not a string!.

  TOC < Back Next > - WIP Wiki Feedback Admin