Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

SynHole (Syntax Hole)

Definition

SynHole VarName

Fields

FieldTypeDescription
contentsVarNameThe hole identifier/name

Description

SynHole represents a placeholder or “hole” in the AST that can be filled later during metaprogramming or code generation. This is useful for:

  • Template generation
  • Partial AST construction
  • Code synthesis tools

The VarName identifies the hole for later substitution.

Nix Source ↔ AST

There is no direct Nix syntax for SynHole: it is constructed programmatically.

{
  "tag": "SynHole",
  "contents": "myHole"
}

Nix Library Access

syntax.mkSynHole "myHole"