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

List indexing with variables #59

Closed
sebastian9 opened this issue Jan 31, 2024 · 3 comments · Fixed by #64
Closed

List indexing with variables #59

sebastian9 opened this issue Jan 31, 2024 · 3 comments · Fixed by #64
Labels
bug Something isn't working ready

Comments

@sebastian9
Copy link

Describe the Bug

When attempting to index a list using a variable, the expression A[R] does not produce the expected output. Despite R being set to 3 and A being a list with the values ["Yes", "No", "Yes"], the expected output should be the third element of list A twice, as in "Yes". However, the output is[ 3, 3, 3 ].

FEEL Playground Issue

Steps to Reproduce

evaluate('A[R]',{
"R": 3,
"A": ["Yes","No","Yes"]
})

Expected Behavior

The expression returns the value of the list on the index which matches the variable value; ie, "Yes"

Environment

  • Host (Browser/Node version), if applicable: Node v21.5.0
  • OS: macOS 14.2.1
  • Library version: 3.0.0

Additionally, this can be replicated in the playground -> FEEL Playground Issue

image image
@sebastian9 sebastian9 added the bug Something isn't working label Jan 31, 2024
sebastian9 added a commit to sebastian9/feelin that referenced this issue Jan 31, 2024
@sebastian9
Copy link
Author

I'm not crazy:

image

@nikku nikku added the ready label Jan 31, 2024
@sebastian9
Copy link
Author

@nikku I'm wondering if there's an ETA on this, we'd like to use FEELIN for our project because it keeps things in javascript land. Would you endorse its use in production?

@nikku
Copy link
Owner

nikku commented Feb 7, 2024

@sebastian9 I cannot confirm or deny that feelin is ready for production. Like any software it will have bugs. Also, I don't offer "enterprise support" so you'll need to wait a week or two before I pick up pull requests.

Alternatives exists, such as dsntk/feel-evaluator that could be transpiled to WASM and used in browserland, too. It sets the bar high and fully operates "in the spirit of FEEL", including context sensitivity, DMN-TCK compliance and friends. It may not be as approachable to you as a JavaScript engineer.

nikku pushed a commit that referenced this issue Feb 7, 2024
nikku pushed a commit that referenced this issue Feb 7, 2024
nikku pushed a commit that referenced this issue Feb 7, 2024
@nikku nikku closed this as completed in 60091e5 Feb 7, 2024
@nikku nikku closed this as completed in #64 Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready
Projects
None yet
2 participants