Deprecate the LSL list functions without a direct replacement#73
Deprecate the LSL list functions without a direct replacement#73tapple wants to merge 5 commits intosecondlife:mainfrom
Conversation
| Dialog: (AvatarID: uuid, Text: string, Buttons: {string}, Channel: number) -> (), | ||
| Die: () -> (), | ||
| DumpList2String: (Source: list, Separator: string) -> string, | ||
| DumpList2String: @[deprecated {reason="Use 'table.concat' or 'lljson.encode' instead."}](Source: list, Separator: string) -> string, |
There was a problem hiding this comment.
table.concat is only equivilant if the list does not contain vectors, quaternions, or uuid's
There was a problem hiding this comment.
neither booleans, table.concat()only works with stringand number.
with lljson.encode()we can't choose a separator.
I think that ll.DumpList2String() is still useful.
| ParcelMediaCommandList: (CommandList: list) -> (), | ||
| ParcelMediaQuery: (QueryList: {number}) -> {any}, | ||
| ParseString2List: (Text: string, Separators: {string}, Spacers: {string}) -> {string}, | ||
| ParseStringKeepNulls: (Text: string, Separators: {string}, Spacers: {string}) -> {string}, |
There was a problem hiding this comment.
I replaced ll.ParseStringKeepNulls with string.split in my code, but it has so many more options I don't think it's an adequate deprecation
| Base64ToString: (Text: string) -> string, | ||
| BreakAllLinks: () -> (), | ||
| BreakLink: (LinkNumber: number) -> (), | ||
| CSV2List: (Text: string) -> {string}, |
There was a problem hiding this comment.
ll.CSV2List does string trimming as well; not easy to replicate. And I didn't think 'll.List2CSV` should be deprecated if it's pair isn't
generated/slua_default.d.luau
Outdated
| List2List: <T>(ListVariable: {T}, Start: number, End: number) -> {T}, | ||
| List2ListSlice: <T>(ListVariable: {T}, Start: number, End: number, Stride: number, slice_index: number) -> {T}, | ||
| List2ListStrided: <T>(ListVariable: {T}, Start: number, End: number, Stride: number) -> {T}, | ||
| List2List: @[deprecated {use='unpack', reason='Prefer structured tables over strided lists.'}]<T>(ListVariable: {T}, Start: number, End: number) -> {T}, |
There was a problem hiding this comment.
or use table.move(t, start, end, 1, {})
generated/slua_default.d.luau
Outdated
| DeleteCharacter: () -> (), | ||
| DeleteKeyValue: (Key: string) -> uuid, | ||
| DeleteSubList: <T>(Source: {T}, Start: number, End: number) -> {T}, | ||
| DeleteSubList: @[deprecated {use='table.delete', reason='Prefer structured tables over strided lists.'}]<T>(Source: {T}, Start: number, End: number) -> {T}, |
I don't expect this to be merged as-is, or possibly at all. Mostly opening it to have a discussion