September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
17
Task/Currying/Phix/currying.phix
Normal file
17
Task/Currying/Phix/currying.phix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
sequence curries = {}
|
||||
function create_curried(integer rid, sequence partial_args)
|
||||
curries = append(curries,{rid,partial_args})
|
||||
return length(curries) -- (return an integer id)
|
||||
end function
|
||||
|
||||
function call_curried(integer id, sequence args)
|
||||
{integer rid, sequence partial_args} = curries[id]
|
||||
return call_func(rid,partial_args&args)
|
||||
end function
|
||||
|
||||
function add(atom a, b)
|
||||
return a+b
|
||||
end function
|
||||
|
||||
integer curried = create_curried(routine_id("add"),{2})
|
||||
printf(1,"2+5=%d\n",call_curried(curried,{5}))
|
||||
Loading…
Add table
Add a link
Reference in a new issue