Skip to content

Proposal: Bringing preprocessor in line with Firestorm: "LazyLists" #37

@Nensec

Description

@Nensec

This stems from #32

In order to keep compatibility with existing code of people having used the well established Firestorm viewer build-in preprocessor it is important to support its features, or at least its syntax. One such syntax is the ability to refer to lists by their index and typecasting it, which would then be transformed into the appropriate llList2xxx version of that typecast.

Setting values is supported as well, they inject a function for setting values in a list (when needed):

list lazy_list_set(list L, integer i, list v)
{
    while (llGetListLength(L) < i)
        L = L + 0;
    return llListReplaceList(L, v, i, i);
}

As for the translation, they go about it as follows (taken from their wiki):

To obtain a list element, prefix it with a typecast. For example:

list a = [1, 3, "blah", <5.31, 131.7, 11.331>];
llOwnerSay((string)a[2]); // outputs: blah
llOwnerSay((string)((vector)a[3])); // outputs: <5.31000, 131.70000, 11.33100>
llOwnerSay(llList2CSV((list)a[1, 2])); // outputs: 3, blah

will be translated to:

list a = [1, 3, "blah", <5.31, 131.7, 11.331>];
llOwnerSay(llList2String(a, 2));
llOwnerSay((string)(llList2Vector(a, 3)));
llOwnerSay(llList2CSV(llList2List(a, 1, 2)));

For more information see: https://wiki.firestormviewer.org/fs_preprocessor#lazy_lists_addition

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions