SPLURT Station 13 - Modules - TypesDefine Details

code/__HELPERS/_lists.dm

LIST_VALUE_WRAP_LISTSIf value is a list, wrap it in a list so it can be used with list add/remove operations
UNTYPED_LIST_ADDAdd an untyped item to a list, taking care to handle list items by wrapping them in a list to remove the footgun
UNTYPED_LIST_REMOVERemove an untyped item to a list, taking care to handle list items by wrapping them in a list to remove the footgun
LAZYLISTDUPLICATELike LAZYCOPY - copies an input list if the list has entries, If it doesn't the assigned list is nulled
LAZYACCESSreturns L[I] if L exists and I is a valid index of L, runtimes if L is not a list
LAZYADDASSOCLISTThis is used to add onto lazy assoc list when the value you're adding is a /list/. This one has extra safety over lazyaddassoc because the value could be null (and thus cant be used to += objects)
LAZYADDASSOCThis is used to add onto lazy assoc list when the value you're adding is a /list/. This one has extra safety over lazyaddassoc because the value could be null (and thus cant be used to += objects)
LAZYORASSOCLISTPerforms an insertion on the given lazy list with the given key and value. If the value already exists, a new one will not be made.
COMPARE_KEYPassed into BINARY_INSERT to compare keys
COMPARE_VALUEPassed into BINARY_INSERT to compare values
BINARY_INSERTBinary search sorted insert 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/english_list_assocEnglish_list but associative supporting. Higher overhead. @depricated
/proc/listgetindex@depricated
/proc/safepick@depricated
/proc/isemptylist@depricated
/proc/typecacheofLike typesof() or subtypesof(), but returns a typecache instead of a list
/proc/pick_n_takePick a random element from the list and remove it from the list.
/proc/find_recordReturns datum/data/record

Define Details

BINARY_INSERT

Binary search sorted insert 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

LAZYACCESS

returns L[I] if L exists and I is a valid index of L, runtimes if L is not a list

LAZYADDASSOC

This is used to add onto lazy assoc list when the value you're adding is a /list/. This one has extra safety over lazyaddassoc because the value could be null (and thus cant be used to += objects)

LAZYADDASSOCLIST

This is used to add onto lazy assoc list when the value you're adding is a /list/. This one has extra safety over lazyaddassoc because the value could be null (and thus cant be used to += objects)

LAZYLISTDUPLICATE

Like LAZYCOPY - copies an input list if the list has entries, If it doesn't the assigned list is nulled

LAZYORASSOCLIST

Performs an insertion on the given lazy list with the given key and value. If the value already exists, a new one will not be made.

LIST_VALUE_WRAP_LISTS

If value is a list, wrap it in a list so it can be used with list add/remove operations

UNTYPED_LIST_ADD

Add an untyped item to a list, taking care to handle list items by wrapping them in a list to remove the footgun

UNTYPED_LIST_REMOVE

Remove an untyped item to a list, taking care to handle list items by wrapping them in a list to remove the footgun