I was under the impression that in VEX, variables are passed by reference.
Then, can anyone please explain why it's not the case in the following example, ie: once b is passed to a, any further updates to b is not reflected in a's reference(or copy) of b?
dict a = set('name', 'A'); dict b = set('name', 'B'); dict c = set('name', 'C'); a['next'] = b; b['next'] = c; printf(a['name']); // Output 'A', as expected; printf(a['next']['name']); // Output 'B', as expected; printf(b['next']['name']); // Output 'C', as expected; printf(a['next']['next']['name']); // Output nothing, expected output 'C'.
An equivalent example in Python, with expected output would be:
a = dict(name = 'A') b = dict(name = 'B') c = dict(name = 'C') a['next'] = b b['next'] = c print(a['name']) # Output A, as expected; print(a['next']['name']) # Output B, as expected; print(b['next']['name']) # Output C, as expected; print(a['next']['next']['name']) # Output C, as expected.
Thank you, for any advice/insights you may provide.