Patterns, pitfalls, and idioms for writing Verona source code. Use this skill
when writing .v files — library code, _builtin types, or user programs.
-
Use bulk operations over byte-by-byte loops: array.copy_from() wraps
memmove (handles overlapping regions). Use it for shifting data within the
same array instead of while loops.
-
Avoid double-moving data: replace should shift the tail once to its
final position and copy the replacement in, not call erase then insert
(which shifts the tail twice).
-
copy_from for self-overlapping copies: self.data.copy_from(dst, self.data, src, len)
works correctly for overlapping regions — it's memmove, not memcpy.
-
none — no parens needed. Write none not none().
-
Don't use () unnecessarily: if a type or value needs no arguments,
omit the parens. none, true, false, not none(), true(), false().
-
Empty string: string(array[u8]::fill(1)) — a 1-byte array containing
just the null terminator, with len=0.