Anonymous user
Talk:Partial function application: Difference between revisions
→Proposal for new task description: ruby 1.9
m (→Proposal for new task description: typo) |
(→Proposal for new task description: ruby 1.9) |
||
Line 237:
<lang ruby>
def f
proc {|a, b, x| a * x + b}
end
def f2(a, b, x)
end
def g
proc {
end
def main
w = g[7][9]▼
end
main
▲u = f2.curry[7][9]
▲v = f2.curry[7,9]
▲w = g[7][9]
▲puts [ [1,2,3,4,5].map {|x| u[x]} \
▲ , [1,2,3,4,5].map {|x| v[x]} \
▲ , [1,2,3,4,5].map {|x| w[x]} ]
</lang>
|