code/__HELPERS/lists.dm
COMPARE_KEY | Passed into BINARY_INSERT to compare keys |
---|---|
COMPARE_VALUE | Passed into BINARY_INSERT to compare values |
BINARY_INSERT_TG | Binary search sorted insert from TG INPUT: Object to be inserted LIST: List to insert object into TYPECONT: The typepath of the contents of the list COMPARE: The object to compare against, usualy the same as INPUT COMPARISON: The variable on the objects to compare COMPTYPE: How should the values be compared? Either COMPARE_KEY or COMPARE_VALUE. |
/proc/pickweight | Picks an element based on its weight. L - The input list |
/proc/pick_multiple_unique | Picks multiple unique elements from the suplied list. If the given list has a length less than the amount given then it will return a list with an equal amount |
LAZYDISTINCTADD | Adds I to L, initializing L if necessary, if I is not already in L |
ISINDEXSAFE | Returns whether a numerical index is within a given list's bounds. Faster than isnull(LAZYACCESS(L, I)). |
LAZYIN | If the lazy list is currently initialized find item I in list L |
/proc/make_associative | A proc for turning a list into an associative list. |
/proc/compare_list | compare two lists, returns TRUE if they are the same |
Define Details
BINARY_INSERT_TG
Binary search sorted insert from TG INPUT: Object to be inserted LIST: List to insert object into TYPECONT: The typepath of the contents of the list COMPARE: The object to compare against, usualy the same as INPUT COMPARISON: The variable on the objects to compare COMPTYPE: How should the values be compared? Either COMPARE_KEY or COMPARE_VALUE.
COMPARE_KEY
Passed into BINARY_INSERT to compare keys
COMPARE_VALUE
Passed into BINARY_INSERT to compare values
ISINDEXSAFE
Returns whether a numerical index is within a given list's bounds. Faster than isnull(LAZYACCESS(L, I)).
LAZYDISTINCTADD
Adds I to L, initializing L if necessary, if I is not already in L
LAZYIN
If the lazy list is currently initialized find item I in list L