Skip to content

Trouble with binary expression in doc generation #995

@jrozentur

Description

@jrozentur

I am trying to return a document to the rest call. The document contains results of a match array, and a binary conclusion

> accept[result]{
 c=3
 a=[1,2,3]
 result={"v":a}
}
Rule 'accept' defined in package repl. Type 'show' to see rules.
> accept
[
  {
    "v": [
      1,
      2,
      3
    ]
  }
]

This is correct, but let's add a conditional:

> accept[result]{
 c=3
 a=[1,2,3]
 result={"ok":c==0, "v":a}
}
Rule 'accept' defined in package repl. Type 'show' to see rules.
> accept
[]

Why is the resulting doc empty? c is a bound variable, and I should be able to use it in an expression, the problem is when the expression is binary

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions