Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
GeneralStonewall
Magician


Joined: 02 Feb 2004
Posts: 364
Location: USA

PostPosted: Tue Jun 29, 2010 10:00 am   

[3.21] BUG: Infinite loop with #delitem
 
I believe this may be related to http://forums.zuggsoft.com/forums/viewtopic.php?t=35420

The following script causes an infinite loop:

Code:
#print ""
#print "---- Setting up testdb ----"
#var testdb %null
#addkey testdb key1 val1
#print {testdb: %expanddb( @testdb)}
#print "Executing #forall loop nested in #loopdb"
#loopdb @testdb {
  #forall %val {
    #delitem testdb.%key {%i}
    }
  }


If the #delitem is replaced with an #echo, then there's no issue.
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Tue Jun 29, 2010 1:38 pm   
 
Infinite loop confirmed and it looks like the #delitem is somehow resetting (or not advancing) the outer loop db. That some pretty wonky code though. What exactly were you trying to do when you came across this? I'm pretty sure theres a better way to do it.
_________________
Asati di tempari!
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Jun 29, 2010 4:55 pm   
 
Hmm, interesting. Looks like #loopdb isn't making a proper copy of the table somehow. Although the #FORALL statement is also suspect because you are looping on a string value (val1) and not a real string list.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net