Skip to content

Beginner question - How is this recursive predicate is evaluated? #85

Answered by p0
MikeTheSnowman asked this question in General
Discussion options

You must be logged in to vote

This is a great question. I'll give the full details on recursive predicates below, but let's first deal with result.

Also, how does this line work exactly?:

country = getANeighbor(result)

With some of the simple examples that are given in the CodeQL handbook, they make it seem like that the 'result' keyword almost acts like 'return' in other languages. I feel that I have a fundamental misunderstanding of what 'result' does and how it works. I can't seem to find a good explanation after googling.

You're right to observe that in many examples result = f() in CodeQL seems to act like return f() in other languages. However, a return statement (with its usual meaning of actually interruptin…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
2 replies
@MikeTheSnowman
Comment options

@p0
Comment options

Answer selected by pwntester
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants