Executes a body of code if a form evaluates to non-nil, propagating the result of the form through the body of code.
when-let (var form) &body body => result
A variable whose value is used in the evaluation of body.
A form, which must evaluate to non-nil.
A body of code to be evaluated conditionally on the result of form.
The result of evaluating body using the value var.
This macro executes the body of code if the form evaluates to a non-nil result. Within the body, the variable var is bound to the result of the form.
(when-let (position (search string1 string2))
(let ((position (search string1 string2)))
LispWorks User Guide and Reference Manual - 13 Feb 2015