Module moonwalk.sugar

Syntax sugar.

Functions

sweeten (fn, argc) Sweeten a function.


Functions

sweeten (fn, argc)
Sweeten a function. This effectively allows functions taking multiple arguments to be "called without parentheses." You probably don't need to use this.

method, argc should include the hidden self argument.

If the wrapper is called with less than argc arguments, it will return a continuation object that can be called or concatenated with any remaining arguments. Otherwise, it will tail-call fn and return the result.

Parameters:

  • fn A function taking a fixed number of non-optional arguments.
  • argc The number of arguments fn takes. If fn is a table

Returns:

    A wrapper function for fn.
generated by LDoc 1.4.0