Nested function: Difference between revisions
Content deleted Content added
added c++ |
added ruby |
||
Line 227:
print(makeList(". "))</lang>
=={{header|Ruby}}==
<lang ruby>def makeList(separator)
counter = 1
makeItem = lambda {|item|
result = "#{counter}#{separator}#{item}\n"
counter += 1
result
}
makeItem["first"] + makeItem["second"] + makeItem["third"]
end
print makeList(". ")</lang>
=={{header|Scheme}}==
|