A simple test follows:
${message}
Now perform a list assignment:
<#assign hash = {"temp", "Temporary"}> <#assign mymessage = "hello"> <#assign test = [ "test1", "test23", "test45", message, mymessage]> The list contains #{test?size} items. <#foreach item in test>${item}
#foreach>Now update the assignment and repeat:
<#assign mymessage = "world"> <#foreach item in test>${item}
#foreach>Now reassign the list and repeat:
<#assign test = [ hash.temp, "test1", "test23", "test45", mymessage, "hash", hash["temp"]]> <#assign test = [ "foo", "bar" ] + test> <#foreach item in test[1..4]>${item}
#foreach>Silly, but necessary tests, for one and zero element lists:
<#assign test = [ "Hello, world" ]> <#foreach item in test>${item}
#foreach>Zero item test:
<#assign test = []> <#foreach item in test>${item}
#foreach>Dumb test for number literals -- these weren't working as expected:
<#assign test = [] + [1, 2,3, 5, 7]> <#foreach item in test>${item}
<#if item == 5><#break>#if> #foreach>