func

The function class for Cheddar

Arguments:

arguments matrix:

function body:

Usage:

-> (a, b = 0) a + b, with api:

new cheddar.func(
  [
    ["a", {}],
    ["b", {
        Default: cheddar.init(
          cheddar.number,
          10, 0, 0
        )
    }]
  ],
  function(scope, input) {
    return cheddar.init(
      cheddar.number,
      10, 0,
      input("a").value + input("b").value
    );
  }
)

Internal Usage

Execution:

func.exec([
    arg1, arg2, ...
], scope)

scope will be set to self variable, if none, set to null.

Arguments:

func.args

the 2D matrix representing the arguments the function is requesting.

Last updated