Functions aren't commands

Submitted by javelin on Sat, 2002-11-30 18:22

This model explains why typing the following results in a Huh? and nothing else:

  if(1,pemit(num(me),test))

The command parser calls the expression parser, but without telling it to evaluate functions, so the above is treated as a single command, fails to match, and gets you a Huh?. On the other hand, this:

  [if(1,pemit(num(me),test))] pose

may result in both 'test' being pemitted and a Huh?, because the []'s force the expression parser to recurse and parse what's inside them with mandatory function checking. However, the expression still returns a null string, which is not a valid command, yielding Huh?

In PennMUSH 1.8 and later, however, most admins have enabled the WARN_ON_MISSING internal command, which generates an error message whenever any command starting with "[" is attempted.

Finally:

  [if(1,say[pemit(num(me),test)])] pose

can result in both 'test' being pemitted, and the player saying "pose", because the expression now evaluates to "say", which is a valid command, and pose is taken to be the argument to the say command.