[slscripters] An oddity

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[slscripters] An oddity

Chloe Constantine
I was optimizing some code recently and, in particular, considering compiling it with lsl and mono to see which gives the smaller footprint. (Before you remind me about setting the memory limit in mono the mono compiled script is around 24k (40k free) and the lsl compiled script is around 7k - measured the same way.) The script contains code of the following form:

string a = "...";
string b = "...";                 // where the quoted string is a UUID

list allowed = [a, b];

and then, later, a test

if (llListFindList(allowed, [(string)llGetCreator()]) == -1)

This works in both lsl and mono compiled scripts.

Now, change the type of a and b from string to key and drop the case of llGetCreator from key to string

In a mono compiled script the test evaluates to TRUE (assuming that the script is in a prim created by a or b) and yet to FALSE in lsl compiled scripts.

Is this a known problem? And, if it is, where is the problem?

Many thanks,
Chloe

_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
Reply | Threaded
Open this post in threaded view
|

Re: [slscripters] An oddity

Martin Fürholz
Nachricht
For me your script works as expected, whether it's compiled with Mono or not.
 
Tested with:
 
Second Life 3.3.0 (251182) Mar 15 2012 11:29:12 (Second Life Release)
Second Life Server 12.02.24.249991
 
Kind regards,
MartinRJ

 
 -----Ursprüngliche Nachricht-----
Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Chloe Constantine
Gesendet: Donnerstag, 29. März 2012 21:13
An: [hidden email]
Betreff: [slscripters] An oddity

I was optimizing some code recently and, in particular, considering compiling it with lsl and mono to see which gives the smaller footprint. (Before you remind me about setting the memory limit in mono the mono compiled script is around 24k (40k free) and the lsl compiled script is around 7k - measured the same way.) The script contains code of the following form:

string a = "...";
string b = "...";                 // where the quoted string is a UUID

list allowed = [a, b];

and then, later, a test

if (llListFindList(allowed, [(string)llGetCreator()]) == -1)

This works in both lsl and mono compiled scripts.

Now, change the type of a and b from string to key and drop the case of llGetCreator from key to string

In a mono compiled script the test evaluates to TRUE (assuming that the script is in a prim created by a or b) and yet to FALSE in lsl compiled scripts.

Is this a known problem? And, if it is, where is the problem?

Many thanks,
Chloe

_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
Reply | Threaded
Open this post in threaded view
|

Re: [slscripters] An oddity

Martin Fürholz
In reply to this post by Chloe Constantine
Nachricht
Nevermind my last email. Testing again. :)
-----Ursprüngliche Nachricht-----
Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Chloe Constantine
Gesendet: Donnerstag, 29. März 2012 21:13
An: [hidden email]
Betreff: [slscripters] An oddity

I was optimizing some code recently and, in particular, considering compiling it with lsl and mono to see which gives the smaller footprint. (Before you remind me about setting the memory limit in mono the mono compiled script is around 24k (40k free) and the lsl compiled script is around 7k - measured the same way.) The script contains code of the following form:

string a = "...";
string b = "...";                 // where the quoted string is a UUID

list allowed = [a, b];

and then, later, a test

if (llListFindList(allowed, [(string)llGetCreator()]) == -1)

This works in both lsl and mono compiled scripts.

Now, change the type of a and b from string to key and drop the case of llGetCreator from key to string

In a mono compiled script the test evaluates to TRUE (assuming that the script is in a prim created by a or b) and yet to FALSE in lsl compiled scripts.

Is this a known problem? And, if it is, where is the problem?

Many thanks,
Chloe

_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
Reply | Threaded
Open this post in threaded view
|

Re: [slscripters] An oddity

Martin Fürholz
In reply to this post by Chloe Constantine
Nachricht
Alright, there IS some oddity.
 
If you declare "list allowed" at global level there will happen the discrepancy you've mentioned ( TRUE == llListFindList(allowed, [llGetCreator()]) == -1 ) if LSL, ( FALSE == llListFindList(allowed, [llGetCreator()]) == -1 ) if MONO - compiled.
 
But if you declare list allowed = [a,b] inside the touch-event for example, it works the same way for mono and LSL - scripts.
 
Kind regards.
-----Ursprüngliche Nachricht-----
Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Chloe Constantine
Gesendet: Donnerstag, 29. März 2012 21:13
An: [hidden email]
Betreff: [slscripters] An oddity

I was optimizing some code recently and, in particular, considering compiling it with lsl and mono to see which gives the smaller footprint. (Before you remind me about setting the memory limit in mono the mono compiled script is around 24k (40k free) and the lsl compiled script is around 7k - measured the same way.) The script contains code of the following form:

string a = "...";
string b = "...";                 // where the quoted string is a UUID

list allowed = [a, b];

and then, later, a test

if (llListFindList(allowed, [(string)llGetCreator()]) == -1)

This works in both lsl and mono compiled scripts.

Now, change the type of a and b from string to key and drop the case of llGetCreator from key to string

In a mono compiled script the test evaluates to TRUE (assuming that the script is in a prim created by a or b) and yet to FALSE in lsl compiled scripts.

Is this a known problem? And, if it is, where is the problem?

Many thanks,
Chloe

_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
Reply | Threaded
Open this post in threaded view
|

Re: [slscripters] An oddity

Martin Fürholz
In reply to this post by Chloe Constantine
Nachricht
key a = "some valid uuid";
key b = "some valid uuid";
list allowed = [a,b];
default
{
 
}
 
Only if compiled with LSL and if "list allowed" is declared global the list-entries will be of type key.
 
If "list allowed" is declared (or assigned) in an event the list-entries will be of type string.
If "list allowed" is declared (or assigned) in a mono-compiled script the list-entries will be of type string.
-----Ursprüngliche Nachricht-----
Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Chloe Constantine
Gesendet: Donnerstag, 29. März 2012 21:13
An: [hidden email]
Betreff: [slscripters] An oddity

I was optimizing some code recently and, in particular, considering compiling it with lsl and mono to see which gives the smaller footprint. (Before you remind me about setting the memory limit in mono the mono compiled script is around 24k (40k free) and the lsl compiled script is around 7k - measured the same way.) The script contains code of the following form:

string a = "...";
string b = "...";                 // where the quoted string is a UUID

list allowed = [a, b];

and then, later, a test

if (llListFindList(allowed, [(string)llGetCreator()]) == -1)

This works in both lsl and mono compiled scripts.

Now, change the type of a and b from string to key and drop the case of llGetCreator from key to string

In a mono compiled script the test evaluates to TRUE (assuming that the script is in a prim created by a or b) and yet to FALSE in lsl compiled scripts.

Is this a known problem? And, if it is, where is the problem?

Many thanks,
Chloe

_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters
Reply | Threaded
Open this post in threaded view
|

Re: [slscripters] An oddity

Martin Fürholz
In reply to this post by Chloe Constantine
Nachricht
-----Ursprüngliche Nachricht-----
Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Chloe Constantine
Gesendet: Donnerstag, 29. März 2012 21:13
An: [hidden email]
Betreff: [slscripters] An oddity

I was optimizing some code recently and, in particular, considering compiling it with lsl and mono to see which gives the smaller footprint. (Before you remind me about setting the memory limit in mono the mono compiled script is around 24k (40k free) and the lsl compiled script is around 7k - measured the same way.) The script contains code of the following form:

string a = "...";
string b = "...";                 // where the quoted string is a UUID

list allowed = [a, b];

and then, later, a test

if (llListFindList(allowed, [(string)llGetCreator()]) == -1)

This works in both lsl and mono compiled scripts.

Now, change the type of a and b from string to key and drop the case of llGetCreator from key to string

In a mono compiled script the test evaluates to TRUE (assuming that the script is in a prim created by a or b) and yet to FALSE in lsl compiled scripts.

Is this a known problem? And, if it is, where is the problem?

Many thanks,
Chloe

_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/secondlifescripters