Dictionary updated?
-
If I have an array as a value for a dictionary key, will that value be updated if the array is changed?
-
Just tried it and thatโs how it seems to work...so itโs a pointer?
-
@iTap-Development In almost all coding environments (in.the.world) arrays and dictionaries are references. Which is (most commonly) a variable pointing to a pointer.
So, yes, you can think of them like pointers.
HOWEVER... hyperPad has some places where it locally stores what it finds, without obviously demonstrating that it's created a localised variable containing what it's gotten at a certain time. So that variable will contain what it got, when it got it. Other things in hyperPad dynamically update, some others are references and some seem to be pointers.
A table laying out which is which of everything in hyperPad would SUPER HELPFUL!!!
-
@Deeeds thanks!
-
Arrays, Dictionaries, and Box containers work similarly. Everything else pulls in the information on execution.
-
@Hamed so does it matter performance wise which I use?
-
Use the best one for the job.
If you have a list of data, use an array.
If you have a mapping of data, use a dictionary.
If you have one piece of data, use a box container.
-
@Hamed ๐ thanks!