Overrideable constants
Static configuration pieces that affect compilation

const

Constant definition.
Constants can be used all across functions, exported and imported. If a constant is defined using ?= , it can be overriden by value via compiler flags or imported values.
1
-- This can be overriten with -const "target_peer_id = \"other peer id\""
2
const target_peer_id ?= "this is a target peer id"
3
​
4
-- This constant cannot be overriden
5
const service_id = "service id"
Copied!
You can assign only literals to constants. Constant type is the same as literal type. You can override only with a subtype of that literal type.
Last modified 3mo ago
Copy link