diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2022-10-06 13:16:50 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-06 07:16:50 +0200 |
commit | 723a71bd229cad3498f01c3095a10cf9f6c3255d (patch) | |
tree | 02e51620ef031633f8a78a153eef8351a2e19f60 /doc | |
parent | 964afd30508c40f2a415d96d7bcdcabfeb26ae52 (diff) | |
download | Nim-723a71bd229cad3498f01c3095a10cf9f6c3255d.tar.gz |
follow up #20109; remove `shallow` seqs/strings for ORC (#20502)
* remove `shallow` seqs/strings for ORC * add a changelog item * change url of DelaunayNim
Diffstat (limited to 'doc')
-rw-r--r-- | doc/nimc.md | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/doc/nimc.md b/doc/nimc.md index 0590c42a6..8671e0832 100644 --- a/doc/nimc.md +++ b/doc/nimc.md @@ -778,20 +778,6 @@ For `let` symbols a copy is not always necessary: let s = varA # may only copy a pointer if it safe to do so ``` - -If you know what you're doing, you can also mark single-string (or sequence) -objects as `shallow`:idx:\: - - ```Nim - var s = "abc" - shallow(s) # mark 's' as a shallow string - var x = s # now might not copy the string! - ``` - -Usage of `shallow` is always safe once you know the string won't be modified -anymore, similar to Ruby's `freeze`:idx:. - - The compiler optimizes string case statements: A hashing scheme is used for them if several different string constants are used. So code like this is reasonably efficient: |