Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Nested-function/Wren/nested-function.wren
Normal file
14
Task/Nested-function/Wren/nested-function.wren
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
var makeList = Fn.new { |sep|
|
||||
var counter = 0
|
||||
var makeItem = Fn.new { |name|
|
||||
counter = counter + 1
|
||||
return "%(counter)%(sep)%(name)"
|
||||
}
|
||||
var items = []
|
||||
for (name in ["first", "second", "third"]) {
|
||||
items.add(makeItem.call(name))
|
||||
}
|
||||
System.print(items.join("\n"))
|
||||
}
|
||||
|
||||
makeList.call(". ")
|
||||
Loading…
Add table
Add a link
Reference in a new issue