llParseString2List Problems
|
Alondria LeFay
Registered User
Join date: 2 May 2003
Posts: 725
|
09-24-2004 19:05
Am I the only one whom the new changes to llParseString2List ended up breaking a hoard of code? (I end up using it to parse speach and whatnot, so if someone plops an extra space or whatnot, it blows it away).
Can anyone thing of a good reason the changes?
|
Ama Omega
Lost Wanderer
Join date: 11 Dec 2002
Posts: 1,770
|
09-24-2004 19:50
The good reason was that you had to do a lot of work before to pass null entires. Now, theoretically, you don't.
However, after playing with it this is how I have found it is working now:
llParseString2List(message,[":"],["1","2"]);
If message = a:b we expect and get ["a","b"]
If message = a::b we expect and (now) get ["a","","b"]
If message = :b (null, seperator, b) we now get ["","b"] this seems correct to me, if the seperator is first it must be seperating *something*
If message = a: we have a similar effect of ["a",""] for similar reasons.
Now where I think some extra strangeness is comming in. The second set of tokens (spacers) is treated exactly the same as the first except not discarded.
That means "1:" is two tokens next to each other which means there must be a null between right? So the result is... ["","1","",""]. That is null before a seperator, don't throw away that seperator since its a "spacer", null between the seperators and null after the last seperator.
So yeah, it looks like it got ugly quick. But what is the right behavior? My gut is that spacers should be treated differently than seperators and not parse nulls between them, or at the begining or ends of lists. In this case "1:" would create ["1",""] which seems appropriate to me.
_____________________
-- 010000010110110101100001001000000100111101101101011001010110011101100001 --
|
Azelda Garcia
Azelda Garcia
Join date: 3 Nov 2003
Posts: 819
|
09-24-2004 20:12
Looks like theres scope for several functions in place of just the one ParseString2List, or a few arguments at the end which take default arguments (First, we have to add default arguments into LSL of course).
Azelda
|
Siro Mfume
XD
Join date: 5 Aug 2004
Posts: 747
|
09-25-2004 08:19
I discussed some of these problems and an appropriate fix for removing nulls if you do not need them in your code in this thread: /54/15/23307/1.html
|
Kyrah Abattoir
cruelty delight
Join date: 4 Jun 2004
Posts: 2,786
|
09-26-2004 03:56
i noticed this problem accur on my vendor network system, but it only occur on freshly rezzed vendors, not on the one that are actually working inworld
still seeking a way to fix the bug
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
09-26-2004 12:01
Please see the other thread listed abovehere is a code patch. //data is an input list retrieved from a listen or notecard or some such. list test=[""]; integer findnum; while(1+(findnum = llListFindList(data, test))) { data = llDeleteSubList(data, findnum, findnum); }
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly
Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey
|
Kyrah Abattoir
cruelty delight
Join date: 4 Jun 2004
Posts: 2,786
|
09-26-2004 12:19
im not sure how it will solve my problem, but well i still dont understand where is my vendor bugging, i will investigate as soon as im back in SL (when i have a decent isp)
|
Huns Valen
Don't PM me here.
Join date: 3 May 2003
Posts: 2,749
|
09-26-2004 21:28
WELCOME TO SECOND LIFE
this change makes me feel somewhat peevish if you couldn't tell
|
Don Linden
Bug Reaper
Join date: 14 Jun 2004
Posts: 58
|
09-27-2004 09:10
I will roll back the changes to llParseString2List (so that it acts as it did previously). Instead I will add a llParseStringKeepNulls. =)
Sorry about springing that on ya folks, I have a lot of other things I'm working on and just plowed through that one.
_____________________
Its not a glitch, its a feature.
|
Azelda Garcia
Azelda Garcia
Join date: 3 Nov 2003
Posts: 819
|
09-27-2004 09:21
Errrr, you know that'll break the scripts I just spent several hours patching?
Perhaps, just leave things be now, but bear in mind the possibility of forking functions in the future?
Azelda
|
Eggy Lippmann
Wiktator
Join date: 1 May 2003
Posts: 7,939
|
09-27-2004 10:35
LOL!
|
Don Linden
Bug Reaper
Join date: 14 Jun 2004
Posts: 58
|
09-27-2004 11:21
The problem with leaving it as it is would be that scripts which are broken and not modifiable by the creator will still be broken. Reverting back to the previous behaviour would fix this... although unfortunately yes you would have to unfix things you have worked on recently.
I will endeavor to put changes (which I hope will be minimal) up for comment before making them live, in the future. That way we can hopefully avoid this situation in the future :/.
_____________________
Its not a glitch, its a feature.
|
Orlando Mars
Registered User
Join date: 22 Apr 2004
Posts: 73
|
09-27-2004 12:13
I owuld suggest making a new call that fixes the problem and leaving the existing call to work as it was before.
|
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
09-27-2004 14:48
From: someone Originally posted by Eggy Lippmann LOL! Youve taken the words right out of my mouth Eggy  I've already given up on LL's ability to create even a fake programming language. ==Chris
|
Moleculor Satyr
Fireflies!
Join date: 5 Jan 2004
Posts: 2,650
|
09-27-2004 15:35
From: someone Originally posted by Don Linden The problem with leaving it as it is would be that scripts which are broken and not modifiable by the creator will still be broken. Reverting back to the previous behaviour would fix this... although unfortunately yes you would have to unfix things you have worked on recently.
I will endeavor to put changes (which I hope will be minimal) up for comment before making them live, in the future. That way we can hopefully avoid this situation in the future :/. Well, at least it's only taken having to revert only two back-to-back changes to LSL to get y'all to realize that warning your userbase beforehand is a good idea. How about, from now on (on TOP of giving us at least a week's notice on LSL changes), when you announce that the servers are going to be going down the next day for a patch that you release the patch notes THEN, so we can tell you what you're screwing up.
_____________________
</sarcasm>
|
Azelda Garcia
Azelda Garcia
Join date: 3 Nov 2003
Posts: 819
|
09-27-2004 20:42
> The problem with leaving it as it is would be that scripts which are broken and not modifiable by the creator will still be broken. Reverting back to the previous behaviour would fix this... although unfortunately yes you would have to unfix things you have worked on recently.
Ok, but in systems with products that have been put out for sale in the last few days, the same things applies.
Perhaps you can do the following.
Lets assume that LSL bytecode is a one-to-one mapping from a command to binary, eg llSay is 0x01. Now, we assume that llParseString2List is 0x02:
llSay 0x01 (just for illustration) llParseString2List 0x02 (assumption for this post).
The modification you did the other day, changed directly the definition of the function 0x02. The compiler takes llParseString2List and compiles it into bytecode 0x02.
So, to fix this without causing impact, you could do the following:
- create a new bytecode 0x03, which represents a new function llParseString2ListIgnoreNulls - update the compiler to compile llParseString2ListIgnoreNulls into bytecode 0x03 - search and replace the asset server for all scripts compiled before the patch date - replace bytecode 0x02 with bytecode 0x03 in the old scripts
Azelda
|
Siro Mfume
XD
Join date: 5 Aug 2004
Posts: 747
|
09-27-2004 21:34
From: someone Originally posted by Don Linden The problem with leaving it as it is would be that scripts which are broken and not modifiable by the creator will still be broken. Reverting back to the previous behaviour would fix this... although unfortunately yes you would have to unfix things you have worked on recently.
I will endeavor to put changes (which I hope will be minimal) up for comment before making them live, in the future. That way we can hopefully avoid this situation in the future :/. Anyone who made use of the loop I posted to remove nulls will not need to unfix their code (rather than adjusting their parsing code to be specific to list elements). I anticipated this unfix and planned for it. It does mean my scripts will have some meaningless null removal, but they won't break in the future.
|
Huns Valen
Don't PM me here.
Join date: 3 May 2003
Posts: 2,749
|
09-28-2004 16:37
From: someone Originally posted by Don Linden The problem with leaving it as it is would be that scripts which are broken and not modifiable by the creator will still be broken. Reverting back to the previous behaviour would fix this... although unfortunately yes you would have to unfix things you have worked on recently.
I will endeavor to put changes (which I hope will be minimal) up for comment before making them live, in the future. That way we can hopefully avoid this situation in the future :/. Thank you. This is the right thing to do.
|