Clarify description on ds_map_add() to make the difference between the function and the $ accessor clear when overwriting existing keys #4795
Labels
documentation
Improvements or additions to documentation are required by this issue
Description
Hey there,
The manual for ds_map_add contains confusing text, which forced me to try out, what really happens.
Would be great, if you could state the difference between ds_map_add and access through accessor clearly.
Manual says, ds_map_add can return false, if the key exists. This is correct.
Then you show this code examples:
but you mention with no word, that the last line will fail and the function will return false here.
IN ADDITION to that, you added a part for the accessors, when they were released, with almost the same samples,
And again, you mention not with a single word, that in this case the last line will succeed!
This is mega-confusing.
I wrote these few testing lines to prove:
And indeed, the first block prints
to the log and the second block prints
as this block uses ds_map_add instead of the accessors.
You need to make this clear in the manual!
thanks for reading,
kind regards
Gris
Steps To Reproduce
0bd05f22-3783-4e2e-9c0a-879a3d8a9445
The text was updated successfully, but these errors were encountered: