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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
alluran
Adept


Joined: 14 Sep 2005
Posts: 223
Location: Sydney, Australia

PostPosted: Thu Jun 12, 2008 2:54 pm   

Feature Request - Refactor Variables
 
Any chance we could get a way to refactor all references to a variable (including db.key syntax) to something else, package and/or session wide. So I can decide that having all these keys in this single variable isn't as efficient as it could be, and i'd like to rename these 3 keys out to be included in a different record variable
_________________
The Drake Forestseer
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Thu Jun 12, 2008 3:09 pm   
 
The way I do it is by creating a function to do the recall or updating of particular kinds of values. Then if I change how the values are actually stored, I only have to change the function instead of everything that uses it.
Reply with quote
alluran
Adept


Joined: 14 Sep 2005
Posts: 223
Location: Sydney, Australia

PostPosted: Thu Jun 12, 2008 3:49 pm   
 
I could export to xml, search/replace, and reimport too. Not looking for alternatives, looking for a feature. There's reasons the major IDEs support refactoring. cMuds doesn't have to be so comprehensive, basic search replace with a scope would probably work, but would still be a nice feature.
Plus your extra function introduces extra overhead.
_________________
The Drake Forestseer
Reply with quote
Zugg
MASTER


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

PostPosted: Thu Jun 12, 2008 5:36 pm   
 
I've thought about that kind of stuff before, but it's just taken a very low priority compared to all of the other more useful features that are needed (especially mapper stuff). CMUD *does* have a list of all scripts that reference a particular variable (so that CMUD knows to recompile triggers, buttons, etc that depend upon a variable). But it's not foolproof. For example, if you reference a variable within an #EXEC command, then CMUD has no idea about it.

Also, CMUD could only refactor the main variable name. For example, it could change @dbvar into @newdbvar. But it couldn't handle changing "key" values. So it couldn't do @dbvar.key1 -> =@newdbvar.key2 or even @dbvar.key2. The compiler doesn't store specific key references.

Finally, CMUD only has a reference link to existing scripts that have already been compiled, so this would also require going through all packages and making sure that everything compiles (sort of like the compatibility report does).

So yes, it's theoretically possible, but it's a lot of work. I'd really like to focus my time right now on more MUD-related features, rather than programming "IDE" features. Too many people have already complained that I cater too much to programmers/scripters and not enough to actual MUD players.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion 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