RosettaCodeData/Task/Nested-function/Pluto/nested-function.pluto

15 lines
321 B
Text
Raw Permalink Normal View History

2026-04-30 12:34:36 -04:00
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(". ")