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
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Thu Dec 07, 2006 9:24 pm   

[1.20] Nested alias expansion of %i
 
I saw an interesting side effect in my script I was testing, and I pared the code down to a generic example that causes the problem to happen reliably.

Code:
#ALIAS testforall1($list1) {
   #FORALL {$list1} {
      #SAY i1 is %i
   }
}
#ALIAS testforall2($list2) {
   #FORALL {$list2} {
      #SAY i2 is %i
      testforall1 blah
   }
}


Entering 'testforall2 bleh' should give the result:
i2 is bleh
i1 is blah

What I get, however, is:
i2 is bleh
i1 is bleh

The second (inner) %i isn't being expanded correctly.
Reply with quote
Zugg
MASTER


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

PostPosted: Thu Dec 07, 2006 11:35 pm   
 
Yes, we talked about this several months ago. In testforall2, you are really doing a nested loop, and %i points to the outerloop, while %j points to the inner loop. I haven't yet figured out how to deal with this problem, but it's on the bug list.
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Fri Dec 08, 2006 3:06 am   
 
Okay. Thanks for re-confirming it then. I look forward to the eventual fix (obviously). :)
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