onlyif

Usage

<expression1> onlyif <expression2>

Return value

Boolean true or false, depending on the evaluation of <expression2>.

Notes

onlyif is designed as a short circuit within more complex expressions, particularly function definitions. Since Polish notation is evaluated from right to left, an onlyif expression will be evaluated first if it is at the end of a line. If <expression2> returns false, <expression1> is not evaluated, and the result of the overall expression is false.

Example

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.