User Tools

Site Tools


modding:function:and

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
modding:function:and [2017/01/26 21:06] 0xabcdefmodding:function:and [2017/01/27 02:17] 0xabcdef
Line 9: Line 9:
 ^ | [exp2 ... expn]: optional expressions that each evaluate to **Nil** or non-**Nil**. | ^ | [exp2 ... expn]: optional expressions that each evaluate to **Nil** or non-**Nil**. |
 ^ Returns | If all arguments return a non-**Nil** value, then returns the value of the last argument. Otherwise, returns **Nil**. If there is only one argument, then returns the value of that argument. | ^ Returns | If all arguments return a non-**Nil** value, then returns the value of the last argument. Otherwise, returns **Nil**. If there is only one argument, then returns the value of that argument. |
-^ Category | [[logical operator]] |+^ Category | [[logical operator function | logical operator]] |
 ^ Description | Uses lazy evaluation, which means that it stops after it finds a **Nil** value or ends up evaluating every argument if all of them return a non-**Nil** value. | ^ Description | Uses lazy evaluation, which means that it stops after it finds a **Nil** value or ends up evaluating every argument if all of them return a non-**Nil** value. |
  
Line 27: Line 27:
 (and (gr (count (setq foo (list Nil Nil Nil))) 2) 5) (and (gr (count (setq foo (list Nil Nil Nil))) 2) 5)
 </code> </code>
-Returns **5**. Also, **foo** will be set to **300**+Returns **5**. Also, **foo** will be set to **(Nil Nil Nil)**
  
 <code> <code>
modding/function/and.txt · Last modified: 2017/01/27 02:17 by 0xabcdef