 |
Private Adept
Joined: 10 Jan 2002 Posts: 264 Location: USA
|
Posted: Fri Apr 09, 2010 7:11 am
%eval & alias names? what the.... |
#ALIAS 120 {wd 1234567}
wields my 120 weapon...
#show |%eval(135-16)| |%eval(135-15)| |%eval(135-14)| --> |119| || |121|
#UNALIAS 120
#show |%eval(135-16)| |%eval(135-15)| |%eval(135-14)| --> |119| |120| |121|
what the?!?!
ive had similar aliases since zMud 2.0 |
|
Last edited by Private on Fri Apr 09, 2010 9:10 am; edited 1 time in total |
|
|
 |
charneus Wizard

Joined: 19 Jun 2005 Posts: 1876 Location: California
|
|
|
 |
Private Adept
Joined: 10 Jan 2002 Posts: 264 Location: USA
|
Posted: Fri Apr 09, 2010 9:09 am |
heh, Posted: 08 Jan 2008 22:44... and STILL a bug... nice
%eval should NOT parse alias names!
>#ALIAS foo {bar}
>#SHOW %eval(foo)
no output
>#UNALIAS foo
>#SHOW %eval(foo)
foo
it aint only with numbered aliases |
|
|
 |
charneus Wizard

Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Fri Apr 09, 2010 9:28 am |
Heh.
Zugg wrote: |
The numerical aliases issue isn't going to get fixed anytime soon because you are not supposed to use numeric aliases in the first place. |
from:
http://forums.zuggsoft.com/forums/viewtopic.php?p=154878
Either way, an alias with numbers starting it will not get fixed.
Charneus |
|
|
 |
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Fri Apr 09, 2010 1:13 pm |
From the help page for %eval:
Quote: |
NB: Do not use this function unless you're sure you have to. While it was used very often in zMUD, most of its uses have been deprecated in CMUD. In CMUD, evaluating an expression is as simple as surrounding it in brackets.
Use of this function is inadvisable because its argument is treated as a string and only compiled at runtime, which is slower than simply using brackets.
|
In other words, just use (135-16) instead of %eval(135-16) |
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Apr 09, 2010 3:18 pm |
zMUD was never intended to allow numeric alias names either. It was actually a bug in zMUD. For compatibility, CMUD has some limited support for aliases that start with or contain numbers, but they will only work from the command line and not from within scripts.
And yes, as Rahab said, you should be getting rid of most of your %eval calls in CMUD. They are no longer needed. |
|
|
 |
|
|