kw dynamic
Reserved keyword
The list of words: §1.4
Syntax
Dynamic = "dynamic" Ident "{" { Field } "}" ;Grammar: App. A
Defined in
- 14.2 Dynamic configuration — dynamic Name { …
- 3.4 Declared types — data — a product type with named fields (§4.2).
- 1.4 Keywords — Reserved (cannot be used as names)
Examples
dynamic Limits {
rps: u32 = DEFAULT_RPS
newSearch: Flag = Flag.off
}
let l = Limits.get()
if current > l.rps.get() { throttle() }
for await v in l.rps.changes() { limiter.set(v) }
if l.newSearch.on(for: ctx.caller) { newSearch(q) } else { oldSearch(q) }