modding:function:if
Differences
This shows you the differences between two versions of the page.
| modding:function:if [2014/12/27 04:40] – external edit 127.0.0.1 | modding:function:if [2017/01/25 23:31] (current) – 0xabcdef | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | [[modding: | + | [[if Talk Page|Discuss this page]] |
| === if === | === if === | ||
| - | [[modding:function:if]] | + | See [[http:// |
| ^ Syntax | (if condition exp1 [exp2]) -> value | | ^ Syntax | (if condition exp1 [exp2]) -> value | | ||
| ^ Arguments | condition: anything that evaluates to Nil or non-Nil | | ^ Arguments | condition: anything that evaluates to Nil or non-Nil | | ||
| - | ^ | exp1: an expression that gets invoked | + | ^ | exp1: an expression that gets evaluated |
| - | ^ | [exp2]: an optional expression that gets invoked | + | ^ | [exp2]: an optional expression that gets evaluated |
| ^ Returns | value: Whatever the expression that gets invoked returns | | ^ Returns | value: Whatever the expression that gets invoked returns | | ||
| ^ Category | [[control structure functions|control structure]] | | ^ Category | [[control structure functions|control structure]] | | ||
| ^ Description | Basic branching function. Allows executing something only if a certain condition is met. A fundamental thing. | | ^ Description | Basic branching function. Allows executing something only if a certain condition is met. A fundamental thing. | | ||
| + | |||
| + | Unless **condition** explicitly evaluates Nil, the function considers it to be **true**. This works for any **Nil** value in any data type: **error**, **function**, | ||
| + | < | ||
| + | (neq condition Nil) | ||
| + | </ | ||
| === Example === | === Example === | ||
modding/function/if.1419655255.txt.gz · Last modified: (external edit)
