Template Qdeql is an esolang built as an extension of Qdeql.
Template Qdeql adds the following features to Qdeql:
- Functions. Define them with braces, then call them by stating their name:
Function definitions cannot be nested, and function calls must be surrounded by whitespace.
subtract{ \--\/\/=/ } && subtract * - Integer constants. These can be redefined indefinitely and are dynamically scoped.
NB: because integers are evaluated during compilation, they are agnostic to the program's control flow!
x:1 # set x to 1 y:2 z:3 x:y+1 x:4_z # subtraction uses _ rather than - - Repeated code:
A repetition may include Qdeql code, or a function call, but not both.
n:5 n::= # compiles to "====="
Because this uses characters otherwise ignored in Qdeql, comments must start with #.
You can run Template Qdeql directly with civet src/index.civet if you have Civet installed globally (using npx civet to use the local Civet doesn't work -- see this issue). Alternatively, you can compile to JS using npm run build, and then run node dist/index.mjs.
After running npm run build, you may npm i -g . to add template-qdeql to your PATH as tqdeql.