Copy a string: Difference between revisions

Content deleted Content added
→‎{{header|Tcl}}: added notes on value copying
Line 448:
 
=={{header|Tcl}}==
<lang tcl>set src "Rosetta Code"
 
set dst $src "Rosetta Code"</lang>
Tcl copies strings internally when needed. To be exact, it uses a basic value model based on simple objects that are immutable when shared (i.e., when they have more than one effective reference to them); when unshared, they can be changed because the only holder of a reference has to be the code requesting the change. At the script level, this looks like Tcl is making a copy when the variable is assigned as above, but is more efficient in the common case where a value is not actually modified.
set dst $src
 
=={{header|Toka}}==