Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,13 @@
val src = "Hello"
// Its actually not a copy but a reference
// That is not a problem because String is immutable
// In fact its a feature
val des = src
assert(src eq des) // Proves the same reference is used.
// To make a real copy makes no sense.
// Actually its hard to make a copy, the compiler is too smart.
// mkString, toString makes also not a real copy
val cop = src.mkString.toString
assert((src eq cop)) // Still no copyed image
val copy = src.reverse.reverse // Finally double reverse makes a copy
assert(src == copy && !(src eq copy))// Prove, but it really makes no sense.