• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

 Data structures as true data types : What do you mean?

I

izark

Guest
Hi !
Implement Data structures as true data types:
I am not a programmer, and I don´t understand what that means. It is on the roadmap.
Could you please explain it to me? How are data types implemented in Gamemaker then?
When the change is made, will it break code? Or will it make it faster? I mean, why are they making this change at all.
I use lists A LOT in my game, and queues and arrays, I don´t know how this will affect the game, should I worry?
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
Currently data structures are handled by index, meaning that when you do
Code:
list = ds_list_create();
`list` will be equal to 0, 1, 2, and so on.
This is generally okay, but means that you cannot easily tell apart different data structures because they all have indexes start at 0 (as with other resources), which can lead to harder-to-debug errors if mixing things up on accident.

With the change, `list` would be equal to an actual data structure' reference, much like the arrays work (and doing string(list) could return "list(...contents)" instead of "1"). Unless you were doing something very unusual, this would not break any existing code.
 
I

izark

Guest
Currently data structures are handled by index, meaning that when you do
Code:
list = ds_list_create();
`list` will be equal to 0, 1, 2, and so on.
This is generally okay, but means that you cannot easily tell apart different data structures because they all have indexes start at 0 (as with other resources), which can lead to harder-to-debug errors if mixing things up on accident.

With the change, `list` would be equal to an actual data structure' reference, much like the arrays work (and doing string(list) could return "list(...contents)" instead of "1"). Unless you were doing something very unusual, this would not break any existing code.
Thanks, it is much clearer now ! If they are going to work as a reference type, like arrays, much better then.
 
Top