Repository navigation
[Query] Inspect Recursive Functions
Generated from 'wiki-query.ts' on 2026-11-08, 09:20:49 UTC (v2.17.4), do not edit directly.
Inspect Recursive Functions Query [overview]
Determine whether functions are recursive
This query is requested with the type inspect-recursion.
Run in the REPL: :query @inspect-recursion [(<crit>;...)] <code | file://path>
With this query you can identify which functions in the code are recursive. Please note, that functions that may be recursive due to indirect calls are also considered recursive.
Using the example code fact <- function(n) { if(n <= 1) 1 else n * fact(n - 1) } the following query returns the information for all identified function definitions whether they are recursive:
[ { "type": "inspect-recursion" } ](This can be shortened to @inspect-recursion when used with the REPL command :query).
Results (prettified and summarized):
Query: inspect-recursion
- Function 21 (1.9-57) is recursive
Show Detailed Results as Json
The analysis ran (including parsing and normalization and the query) within the generation environment.
The JSON contains the ids of the nodes in question (see the Interface wiki page).
{"inspect-recursion":{".meta":{},"recursive":{"21":true}},".meta":{}}Original Code
fact <- function(n) { if(n <= 1) 1 else n * fact(n - 1) }This query also supports a slicing criterion based query mode that only returns information for functions matching the given criteria:
[ { "type": "inspect-recursion", "filter": [ "1@function" ] } ](This can be shortened to @inspect-recursion (1@function) "fact <- function(n) { if(n <= 1) 1 else n * fact(n - 1) }" when used with the REPL command :query).
Results (prettified and summarized):
Query: inspect-recursion
- Function 21 (1.9-57) is recursive
Show Detailed Results as Json
The analysis ran (including parsing and normalization and the query) within the generation environment.
The JSON contains the ids of the nodes in question (see the Interface wiki page).
{"inspect-recursion":{".meta":{},"recursive":{"21":true}},".meta":{}}Original Code
fact <- function(n) { if(n <= 1) 1 else n * fact(n - 1) }Implementation Details
The Inspect Recursive Functions Query is executed by executor.
Currently maintained by Florian Sihler and Oliver Gerstl at Ulm University
Email | GitHub | Penguins | Portfolio
- 🧑💻 Developer Onboarding
- 💻 Setup
- 👓 Overview
- 🪟 Interfacing with flowR
- 🌋 Core
- 🧹 Testing & Linting (Benchmark Page)
⁉️ FAQ- ℹ️ Extra Information