BTW: there is a bug in the "for" statement. It doesn't strip leading and trailing blanks from list items. The above template uses a fixed version. The bug can be worked around using re() to strip of leading and trailing blanks. Or
Code:
g = list_item(g, 0, ',').