Coder Social home page Coder Social logo

Comments (2)

SaladDais avatar SaladDais commented on June 13, 2024

May be more complicated than I thought:

key glob_uuid = "<some_uuid>";
// float but with an "int-like" constant
float int_like = 1;
float int_like_2 = int_like;
list list_glob = [glob_uuid, int_like, int_like_2];

default
{
    state_entry()
    {
        key local_uuid = "<some_uuid>";
        llOwnerSay(
            // string-like under LSO
            (string)llGetListEntryType(list_glob, 0) +
            // int-like under LSO
            (string)llGetListEntryType(list_glob, 1) +
            // also int-like under LSO
            (string)llGetListEntryType(list_glob, 2) +
            // float-like under both LSO and mono
            (string)llGetListEntryType((list)int_like, 0) +
            // float-like under both LSO and mono
            (string)llGetListEntryType([int_like], 0) +
            // key-like under both LSO and mono
            (string)llGetListEntryType([glob_uuid], 0) +
            // string-like under LSO
            (string)llGetListEntryType((list)glob_uuid, 0) +
            // key-like under both LSO and mono
            (string)llGetListEntryType([local_uuid], 0) +
            // string-like under LSO.
            (string)llGetListEntryType((list)local_uuid, 0)
        );
    }
}

Prints "311224343" under LSO but "422224444" under Mono. I suspect key values are usually stored on the heap as an LST_STRING, and the "key-ness" is specifically added by the instruction that pushes the entry onto the list in the list expression case (which is typed and forces key.)

keys appears to always lose key-ness as do global list "expressions" (really simpleassignables under LL's compiler,) as do list casts.

There's some similar logic for floats with "int-like" constants under LSO, but "float-ness" is never lost through casting a global because it doesn't have an existing heap entry that can be used like keys do.

from tailslide.

SaladDais avatar SaladDais commented on June 13, 2024

Mostly handled in the LSO branch. Currently the constant value propagation more closely matches Mono so using non-strict global validation or optimization on scripts meant to run on LSO will break them. Would need LSO-specific constant value propagation to support it, and I'm not really interested in doing that right now.

from tailslide.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.