types.WeakRef.clone
Method on every
weakrefclone(): any
Returns this weakref.
Return value
A value == to this. Cloning an atomic reference type such as weakref has nothing to copy piece by piece, unlike types.Table.clone, which builds a new table.
Notes
Takes no arguments. clone is a keyword, so by default wr.clone() and wr.$clone() do not parse. Call it through a computed index, wr["clone"](), or write clone wr. With #forbid-clone-operator the word is an ordinary identifier and wr.$clone() compiles. See types.Integer.clone.
Example
let wr = {}.weakref()
let wr2 = wr["clone"]()
println("wr2 == wr =", wr2 == wr)
println("type(wr2) =", type(wr2))Output:
wr2 == wr = true
type(wr2) = weakrefSee also
ref | Returns the value this weakref points at, or null once that value is gone. |
clone | Returns a shallow copy of the table. |
clone | Returns the integer itself. |
| weakref | class index |