Skip to content

Instantly share code, notes, and snippets.

@synap5e
Created April 26, 2016 03:56
Show Gist options
  • Save synap5e/78de33d0972c155e9bf9ac655ed8b383 to your computer and use it in GitHub Desktop.
Save synap5e/78de33d0972c155e9bf9ac655ed8b383 to your computer and use it in GitHub Desktop.
void main() {
{{{int z} y} x} a = {x:{y:{z:1}}};
{{{int z} y} x} b = a;
assert a == b;
b.x.y = {z:2};
assert a != b;
b.x.y.z = 1;
assert a == b;
int[][][] p = [[[1, 2], [3, 4]], [[5, 6]], [[7]]];
int[][][] q = p;
assert q == p;
p[1][0][1] = 0;
assert q != p;
p[1][0][1] = 6;
assert p == q;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment