|
Rainchild Wizard
Joined: 10 Oct 2000 Posts: 1551 Location: Australia
|
Posted: Tue Dec 05, 2006 3:52 am
[1.19] Weird Substitution (28) |
Ok I was chatting to someone on the MUD and typed the following:
reply (more)
The (more) was substituted for the number '28', so what got typed was
reply 28 |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Dec 05, 2006 5:27 pm |
It's the parenthesis issue with the command line, which is on the bug list. To understand why it does this, try putting this in an alias and looking at the compiled code. The (more) causes an expression pointer to be pushed onto the stack. When something like the #IF statement needs to evaluate the expression (or #WHILE needs to evaluate it more than once), it can use this pointer to execute the code to evaluate the expression.
But if something isn't expecting an expression pointer (like the command line), then it just sees a value on the stack and thinks it is a literal value that needs to be appended. The '28' is actually the expression pointer (points to location offset 28 in the code). Since the command line isn't expecting an expression, it just sees the pointer and doesn't know that it needs to jump to the code to evaluate it.
In any case, I'm trying to find a way to allow () on the command line without causing expression evaluation. |
|
|
|
|
|