secondlife / jira-archive

2 stars 0 forks source link

[BUG-6346] Improvement to LSL list data (possibility of lists within lists?) #14215

Open sl-service-account opened 10 years ago

sl-service-account commented 10 years ago

How would you like the feature to work?

I'm not exactly sure as to why lists cannot contain lists, but I figure it has to do with memory allocation, LSL script size, or possibly the number of allowable values within a list (72?)

But because getlistlength is a function, is it not implied that a list's length is known? Wouldn't it be possible to subtract a list's number of values from the greater list's 72, given a greater list containing a lesser list?

Example: list a1 = ["string", float, integer, vector]; list c1 = ["string", float, integer, vector, a1]; llGetListLength(c1) would equal 8, or 72-8 rather than 72-5?

Temporarily combining lists is already a function as well, so i'm really unsure as to why a list cannot contain a list: list a1 = ["string", float, integer, vector]; list a2 = ["string", float, integer, vector]; list a3 = ["string", float, integer, vector]; list a4 = ["string", float, integer, vector]; list all = [a1, a2, a3, a4];

example data pulls using a potential list-within-list definition: list RandomAll = llListRandomize(all, 1); list RandCondensedAll = llDeleteSubList(RandomAll, 2, 3); list Rand2ofAll = llList2List(RandCondensedAll); llSay(0, "2 randomly chosen strings from 4 lists: /n"

A list function to the parent list would not carry down to the child lists, in the sense llRandomizeList(all, 1) would randomize the order of the child lists (a1, a2, a3 -> a3, a1, a2), but the child lists' data would remain in the same "string"/float/integer/vector order.

Why is this feature important to you? How would it benefit the community?

Specifically, this would be useful with list functions such as RandomizeList and DeleteSubList.

Original Jira Fields | Field | Value | | ------------- | ------------- | | Issue | BUG-6346 | | Summary | Improvement to LSL list data (possibility of lists within lists?) | | Type | New Feature Request | | Priority | Unset | | Status | Been Triaged | | Resolution | Triaged | | Reporter | Stikku Habsburg (stikku.habsburg) | | Created at | 2014-06-12T21:20:32Z | | Updated at | 2014-07-09T18:01:42Z | ``` { 'Business Unit': ['Platform'], 'Date of First Response': '2014-07-09T13:01:42.693-0500', 'How would you like the feature to work?': 'I\'m not exactly sure as to why lists cannot contain lists, but I figure it has to do with memory allocation, LSL script size, or possibly the number of allowable values within a list (72?)\r\n\r\nBut because getlistlength is a function, is it not implied that a list\'s length is known?\r\nWouldn\'t it be possible to subtract a list\'s number of values from the greater list\'s 72, given a greater list containing a lesser list?\r\n\r\nExample:\r\nlist a1 = ["string", float, integer, vector];\r\nlist c1 = ["string", float, integer, vector, a1];\r\nllGetListLength(c1) would equal 8, or 72-8 rather than 72-4?\r\n\r\nTemporarily combining lists is already a function as well, so i\'m really unsure as to why a list cannot contain a list:\r\nlist a1 = ["string", float, integer, vector];\r\nlist a2 = ["string", float, integer, vector];\r\nlist a3 = ["string", float, integer, vector];\r\nlist a4 = ["string", float, integer, vector];\r\nlist all = [a1, a2, a3, a4];\r\n\r\nexample data pulls:\r\nlist RandomAll = llRandomizeList(all, 1);\r\nlist RandCondensedAll = llDeleteSubList(RandomAll, 2, 3);\r\nlist Rand2ofAll = llList2List(RandCondensedAll);\r\nllSay(0, "2 randomly chosen strings from 4 lists: /n" \r\n+ llList2String(Rand2ofAll, 0(0)) + "/n"\r\n+ llList2String(Rand2ofAll, 1(0)));\r\n\r\nA list function to the parent list would not carry down to the child lists, in the sense llRandomizeList(all, 1) would randomize the order of the child lists, but the child lists would remain in the same "string"/float/integer/vector order.', 'Target Viewer Version': 'viewer-development', 'Why is this feature important to you? How would it benefit the community?': 'Specifically, this would be useful with list functions such as RandomizeList and DeleteSubList.\r\n', } ```
sl-service-account commented 10 years ago

Stikku Habsburg commented at 2014-06-14T08:07:17Z

If adding the noted feature from my example llList2String(Rand2ofAll, 0(0)) with that second set of parenthesis would be too difficult or otherwise have unintended consequences to working scripts, perhaps the introduction of a new data type specifically for nested lists, and perhaps corrseponding nested list functions would be better? list abunchoflists = [list1, list2, list3, list4]; Would be differentiated from something such as nest abunchoflists = [list1, list2, list3, list4];

and perhaps llNest2 functions?

I dont know enough about high language code to really determine what the easiest way to go about this is, but I'm sure i'm not the only person who thought having a list of lists would be useful at some point.

sl-service-account commented 10 years ago

Stikku Habsburg commented at 2014-06-17T21:02:51Z

JSON_ARRAYS have no appropriate functions to manipulate their data, unlike llList2_functions, ListRandomize, or DeleteSubList.

Json_arrays are surprisingly not versatile, much alike the current Camera parameters within LSL.

sl-service-account commented 10 years ago

Stikku Habsburg commented at 2014-06-17T21:05:16Z, updated at 2014-06-18T07:31:16Z

I believe even if it took a lot of time and hard work, an extension of either lists or the introduction of nests and llNest2_functions, llNestRandomize, llDeleteSubNest that correspond to the List functions, would heavily improve LSL capabilities.

sl-service-account commented 10 years ago

Alexa Linden commented at 2014-07-09T18:01:43Z

Thank you for your suggestion.