Skip to content

modfile: Auto Lambda #158

Description

@xushiwei

A classfile enables Auto Lambda for a specific set of commands by adding an autolambda directive to its gox.mod:

autolambda times(1), forEver(0), onKey(1)

Each entry has the form name(n), where:

  • name is the command's identifier (the function/method name as called in XGo source, e.g. times, forEver, onKey).
  • n is the number of non-lambda arguments the command takes, i.e. the arguments that appear before the (now implicit) trailing lambda.

For example:

Directive entry Full call form Meaning
times(1) times 3, => { ... } 1 argument (3) before the lambda
forEver(0) forEver => { ... } 0 arguments before the lambda
onKey(1) onKey KeySpace, => { ... } 1 argument (KeySpace) before the lambda

A single gox.mod may declare Auto Lambda for multiple commands in one directive, as shown above, or across multiple autolambda lines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions