|
|
|
|
|
by Panzerschrek
220 days ago
|
|
When I say safety I mean inability of the programmer to trigger UB using normal language features, like it's impossible in Rust and several other (less known) languages. Does Doo support it? Or I just can shoot the leg and compiler lets me do this? About references: am I correct, that any value is reference-counted and one can pass it to a function and mutate it (the original, not a copy). |
|
For complex types (strings, arrays, maps), values are reference-counted and passed by reference. If you pass such a value to a function, you're sharing the same object—mutations affect the original. For primitives (Int, Bool), it's pass-by-value (copy).