Module pico8lib.functions

Function manipulation, creation, and helpers

Local Functions

noop () Empty function, useful for callbacks and placeholders
error ([m]) Raise an error with the given message
memoize (f) Create a memoized version of a single parameter function
try (t[, c][, f], ...) try/catch/finally implemented using coroutine return codes


Local Functions

noop ()
Empty function, useful for callbacks and placeholders
error ([m])
Raise an error with the given message

Parameters:

  • m string The error message (string) to output (optional)
memoize (f)
Create a memoized version of a single parameter function

Parameters:

  • f function the function to memoize

Returns:

    function the memoized function
try (t[, c][, f], ...)
try/catch/finally implemented using coroutine return codes

Parameters:

  • t function function to always call first
  • c function function to call if t raises an error (optional)
  • f function function to call if t or c succeeds without error (optional)
  • ... Additional parameters that will be passed to t, c, and f

Returns:

  1. bool Did t exit without error?
  2. Error message or successful return value from t
generated by LDoc 1.5.0 Last updated 2024-09-08 19:10:26