lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

--- Reuben Thomas wrote:
> Yes, curry is simply:
> function curry (f, ...)
>   local fix = arg
>   return function (...)
>            return f (unpack (fix), unpack (arg))
>          end
> end

You don't need the 'fix', because a unique table is passed in every
time the function is called:

function curry (f, ...)
  return function (...)
    return f (unpack(arg))

Do you Yahoo!?
The New Yahoo! Shopping - with improved product search