DynLex Wiki
Core Rules
This page is the short version of how DynLex works. Start here when code feels confusing.
TL;DR
- DynLex code reads like clear sentences.
- Each sentence shape is a pattern.
- Use imports to bring in more patterns.
- A function gives a reusable name to a pattern.
- If a plain word from a function pattern is used in that function body, that word becomes a variable.
- Sections group lines. Child lines are indented deeper.
- Some short sections can be written on one line.
- Keep one variable as one value kind (type) during its lifetime.
- Be specific with wording so your line has one clear meaning.
Pattern Words Become Variables
In a plain-word function pattern, DynLex decides variable words by usage.
If you use a pattern word inside the function body, DynLex treats that word as a variable.
function square value:
execute:
return value * value
Here, value becomes a variable because it is used in the body.
Argument, In Simple Words
An argument is the real value you give to that variable slot when calling a function.
In this call, 5 is the argument for value.
Not Core, But Useful
These are common tools you will use often:
loop,
if,
match,
and class.
Open those pages when troubleshooting specific behavior.