Skip to content

Allow binding of function return values #2

@mkremins

Description

@mkremins

Currently you can call all of these functions within a sifting pattern, but you can't bind a function's return value to a logic variable. In practice, this means that only some of the functions (those returning a boolean or usefully boolean-coercible value) are useful, and functions can only be used to directly check yes/no conditions.

The planned syntax for binding function return values looks like this:

(event ?e1 where
  ?prevEntityID: (dec ?e1))

...i.e., an unbound undotted logic variable followed directly by a function call.

The relevant TODO comment in the current version of compiler.js is located here:

// 3. lhs is unbound undotted lvar, rhs is fncall (TODO handle this case)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions