 |
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Sun Aug 03, 2008 2:44 am
[2.35] %eval ( something that evaluates to the name of an alias ) returns null |
This is a very weird bug! And it has been in every version of CMUD so far. Basically, I finally decided to track down why my MUD clock didn't work. It's quick complicated using a lot of aliases, variables, a varfunc etc. so I hadn't been in a hurry to do it! (And it took me a long time to track down too! My clock would be OK or half-OK on some seconds and 0 on others! )
Well, I finally found the problem. I use %eval extensively in it for the calculations. I just read the manual on this and see that they are no longer needed, but that doesn't change that, e.g. %eval(5) should not return null.
Steps to reproduce:
1. Create an alias called "5" (minus the quotes) with anything in it.
2. #SHOW Test eval: %eval(5)
Expected result:
Test eval: 5
Actual result:
Test eval:
3. Or: #SHOW Test eval: %len(%eval(5))
Expected result:
Test eval: 1
Actual result:
Test eval: 0
It doesn't even execute the 5 alias (fortunately), so there's really no excuse for not returning anything. |
|
|
|
 |
charneus Wizard

Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sun Aug 03, 2008 3:15 am |
This was pointed out AGES ago. :P
My topic regarding this issue.
Charneus |
|
|
|
 |
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Sun Aug 03, 2008 3:26 am |
Ah, I wasn't around in January. Well, there was no response from Zugg and it's still not fixed, so I think it's certainly worth reposting in a more readable way. 
|
|
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5187
|
Posted: Sun Aug 03, 2008 3:54 am |
Seb, do you haven alias named "5" or an alias that begins with '5' to connect this with the post Charneus mentioned? I stand by my opininion in that old post that %eval should not be affected by aliases, but you would have to confirm if that is the same bug affecxting you.
If you don't have such an alias I will stick hunting for a reason to this somewhere on my stack of thing to do. That mental pile is getting rather deep. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
 |
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Sun Aug 03, 2008 4:03 am |
No, my alias is named "5", and lots of others that are just numbers.
|
|
|
|
 |
Arde Enchanter
Joined: 09 Sep 2007 Posts: 605
|
Posted: Sun Aug 03, 2008 11:35 am |
| Seb wrote: |
| Ah, I wasn't around in January. Well, there was no response from Zugg and it's still not fixed,... |
Zugg has answered on this question in Beta forum not so much time ago
| 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. |
|
|
|
|
 |
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Sun Aug 03, 2008 1:53 pm |
| 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. |
a) That's an irritating response as I'm sure many will agree. Lots of people got used to using numerical aliases, and why should we not use numerical aliases? They mean we can multiply the number of 1 and 2 character aliases available - very useful for player-killing when you need to be quick with your commands. Typing 11 is going to be quicker and less error-prone than typing q1 or something that starts with a letter (and don't say use qq, because that already does something else).
b) This %eval bug causes working code in zMUD not to work in CMUD in weird and hard to track down ways (because one is not even using these numerical aliases in one's code). Very off-putting for zMUD users thinking of migrating. And making it impossible to create settings that compatible with both zMUD and CMUD, as I would like to do as far as possible.
c) Not being able to use numerical aliases is not listed in the "Changes for zMUD users". (It's just hidden away in the #ALIAS help. People aren't to be expected to read all the help files for commands they are already familiar with. So people are not going to know about this change, and be affected by (b). Same goes for %eval itself.)
d) This %eval bug doesn't just affect numerical aliases, hence it has nothing to do with them, e.g.:
| Code: |
#alias s south
#show %len( %eval( s))
0 |
Yes, that is a contrived example, but there is no reason why %eval shouldn't evaluate something to something that starts with a letter.
 |
|
|
|
 |
charneus Wizard

Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sun Aug 03, 2008 2:54 pm |
Seb, there's a workaround with it, which was pointed out in my post, as well.
Use #ONINPUT {^5$} {commands} here. %eval will still work with the number, and it's just as good as an alias. :P
Charneus |
|
|
|
 |
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Mon Aug 04, 2008 3:18 am |
OK, I'll bear that in mind, thanks.
|
|
|
|
 |
|
|
|