local function make_list(sep) local counter = 0 local function make_item(name) counter += 1 return $"{counter}{sep}{name}" end local items = {} for {"first", "second", "third"} as name do items:insert(make_item(name)) end print(items:concat("\n")) end make_list(". ")