Suppose you make a lambda function with several arguments sometimes you don't want to use all those arguments. There is a way to make that code faster by not evaluating all of the arguments.
Here is a silly example.
Code: Select all
(setq oddEvenMulti (lambda (a %b %c)
(if (eq 1 (modulo a 2))
(multiply a (eval %b))
(multiply a (eval %c))
)
))
As you can see I used % to stop the evaluation until I wanted it. You may ask how would this help?
Consider the case
Code: Select all
(oddEvenMulti (objGetData gplayership "numb") (objGetData (item (sysFindObject gPlayerShip "G") 0) "numb") (objGetData (item (sysFindObject gPlayerShip "G") 1) "numb"))
Now you will never use both stargates so are you using an extra sysFindObject (it is an expensive function), objGetData, and item if you did not use delayed evaluation. This could save you lots of time overall and would make your function more friendly to complex arguments.