 |
GeneralStonewall Magician
Joined: 02 Feb 2004 Posts: 364 Location: USA
|
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Jun 04, 2010 3:59 am |
Yep, confirmed and added to bug list. This is one of those things that I think had a reason a long time ago. Maybe it was just zMUD compatibility. But it doesn't make sense for it to work differently and printing the quotes is what most people would expect. Unless somebody can think of a reason why the quotes should be striped, I'll fix it.
|
|
|
|
 |
GeneralStonewall Magician
Joined: 02 Feb 2004 Posts: 364 Location: USA
|
Posted: Fri Jun 04, 2010 4:05 am |
Well,
| Code: |
var = blah
#print {"@var"} |
prints "@var" literally when used in a script. It makes sense if they're stripped because then it's like a literal string within an expanded one; While if they're not stripped then it doesn't make sense for the variable not to be expanded. Perhaps this is the reason you were thinking of. |
|
|
|
 |
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Fri Jun 04, 2010 3:21 pm |
But even then, General, it doesn't make sense for it to work differently on the commandline than in a script.
|
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Jun 04, 2010 4:48 pm |
Well, yes and no. The "smart command line" assumes that you are normally trying to send stuff to the MUD on the command line, and so it doesn't strip any quotes. Within a script the parser is more strict.
Looking back into this, fixing this doesn't cause any errors in my big parser test script. I'm pretty sure the reason for this was for zMUD compatibility since there were lots of " used in zMUD for crazy things.
However, in the spirit of trying to make CMUD better and make more sense, I have "fixed" this for the next version so that people can test it to see if it causes any unwanted side-effects. In this next version, the quotes are *not* striped, both in scripts and on the command line.
Also, in the above example from General, the *correct* way to prevent a variable from expanding within {} is to do this:
So people can use the ~ escape character rather than using quotes if they run into this issue. |
|
|
|
 |
|
|
|