And (MPI)
From Tapestries MUCK
(Difference between revisions)
(Added a simple functional example.) |
(→and) |
||
Line 9: | Line 9: | ||
This function returns true only if all the arguments evaluate as true. | This function returns true only if all the arguments evaluate as true. | ||
- | + | Functional example: | |
<mpi>{if: | <mpi>{if: | ||
{and:{eq:{sex:me},female},{eq:{species:me},dragon}} | {and:{eq:{sex:me},female},{eq:{species:me},dragon}} | ||
,you can warm this nest | ,you can warm this nest | ||
,only a dragoness can warm this nest}</mpi> | ,only a dragoness can warm this nest}</mpi> |
Latest revision as of 21:57, 24 April 2007
and
{and:expr1,expr2...}
Returns true if expr1 and expr2 evaluate as true. Otherwise, this returns false. If expr1 was false, this doesn't bother to evaluate expr2, as it does C-style shortcutting.
If there are more than two arguments, then this will evaluate all of them until either one returns false, in which case this function returns false, or until it has evaluated all of the arguments.
This function returns true only if all the arguments evaluate as true.
Functional example:
{if: {and:{eq:{sex:me},female},{eq:{species:me},dragon}} ,you can warm this nest ,only a dragoness can warm this nest}