question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inconsistent definition of value nodes

See original GitHub issue

I noticed that “value nodes” are defined differently in language/ast and language/predicates:

export type ValueNode =
  | VariableNode  // <-- missing in isValueNode
  | IntValueNode
  | FloatValueNode
  | StringValueNode
  | BooleanValueNode
  | NullValueNode
  | EnumValueNode
  | ListValueNode
  | ObjectValueNode;
export function isValueNode(node: ASTNode): boolean %checks {
  return (
    node.kind === Kind.INT ||
    node.kind === Kind.FLOAT ||
    node.kind === Kind.STRING ||
    node.kind === Kind.BOOLEAN ||
    node.kind === Kind.NULL ||
    node.kind === Kind.ENUM ||
    node.kind === Kind.LIST ||
    node.kind === Kind.OBJECT ||
    node.kind === Kind.OBJECT_FIELD   // <-- missing in ValueNode
  );
}

Shouldn’t these two definitions be consistent with each other?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
IvanGoncharovcommented, Aug 11, 2018

It seems like you’re correct, unless @IvanGoncharov intentionally wanted isValueNode to mean is a constant value. We may want to switch the naming to better match the type though.

It’s a pure typo on my side. My idea was to match ValueNode exactly.

0reactions
Citocommented, Aug 13, 2018

Thanks. I keep in touch with you when I have ideas or get feedback for improvement.

Read more comments on GitHub >

github_iconTop Results From Across the Web

inconsistent (Statistics Toolbox)
The inconsistency coefficient characterizes each link in a cluster tree by comparing its length with the average length of other links at the...
Read more >
Consistent heuristic - Wikipedia
h is the consistent heuristic function; N is any node in the graph; P is any descendant of N; G is any goal...
Read more >
Inconsistent heuristics in theory and practice
introduced by Mero [34] as a method for propagating inconsistent values in the search from a parent node to its children.
Read more >
Inconsistent Heuristics
The inconsistent heuristics do not have this problem; a node can receive any value, meaning that the distribution of values seen is closer...
Read more >
A* Search with Inconsistent Heuristics
Bidirectional pathmax (BPMX) [Felner et al., 2005] is a method that works with inconsistent heuristics and prop- agates large values to neighboring nodes....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found