Function Lambda (Expression) — skLambda

Addon: skLambda · Category: Expression · Since: 0.0.3-alpha

Syntax

function lambda %string%

Description

Wraps an existing Skript function in a lambda, so it can be stored, passed around, and later invoked with `call`/`run`/`passes` like any other lambda.

The function is looked up by name at runtime. Arguments supplied when the lambda is called are forwarded positionally to the function.

Examples

function double(amount: number) :: number:
	return {_amount} * 2

set {_reward} to function lambda "double"
set {_result} to call lambda {_reward} with 5    # 10

View source