A simple variable on lists that tells you if they are an associated list.
There are tricks to figure this out, but they don't work 100%, namely there is no way to figure out if a list is intended to be treated as associated if all values are intentionally null.
You are gonna need to track this for json, as an associated list with all null values is valid json, and should encode as an object not an array. (I know, because we ran into this issue in our json systems)
Ideally it should be set to 1 on a list that has ever had an associated assignment, even to null. (list["blah"] = null)
len = 0 and cut() to empty the list should ideally clear it, but it wouldn't be too bad if they didn't.
ID:1999366
Dec 17 2015, 1:15 am
|
|||||||
| |||||||