Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow binding of function return values #2

Open
mkremins opened this issue Jun 11, 2021 · 0 comments
Open

Allow binding of function return values #2

mkremins opened this issue Jun 11, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@mkremins
Copy link
Owner

mkremins commented Jun 11, 2021

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)

@mkremins mkremins added the enhancement New feature or request label Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant