Writing Current DQ
This compact checklist helps contributors and AI agents produce code matching
the repository. It is not another specification: follow the
Language Reference and prefer working examples in
stdpkg/, examples/, and autotest/tests/ if this checklist becomes stale.
Default Style
- Use colon/end-keyword blocks and two-space indentation.
- Declare variable types explicitly;
[?]Tinfers only a fixed-array length. - Use
strfor owned text,strviewfor read-only borrowed text, andcstring(N)only for fixed C-compatible storage. - Use double quotes for text and single quotes for a character scalar.
- Use lowercase Boolean operators and uppercase integer/bitwise word operators.
- Prefer
use printandPrintLnfor repository examples over rawprintf.
Ownership and Aliasing
[*]Towns dynamic array storage;[]Tborrows a view.stris managed copy-on-write;.pchar,strview, slices, andcstringdescriptors borrow storage.- Object variables are references. Use
new/deletefor heap objects and<-for fixed storage. - Use
name : ref T,refin,refout, orrefnullonly when aliasing is part of the function contract.
Explicit Boundaries
- Conditions must be
bool; integers are not truthy. - Use
Ordand checked helpers for character or enum ordinals. - Cast pointers explicitly and document lifetime/ABI assumptions.
- In object methods, qualify outside value symbols or use an allowed local
use; do not assume unrestricted module lookup.
Before Submitting
- Compile the changed example or run its closest autotest.
- Add an autotest for a new language rule or boundary case.
- Update the reference for language behavior and the guide only when common usage changes.
- Do not copy rules out of
doc/archive/without revalidating them.