Name

if-let

Usage

macro

Syntax

(if-let (sym test) then-form [else-form])

Description

Assigns the result of test to the local variable sym before doing the if thing. then-form and else-form may refer to sym.

user > (if-let (x (filter odd? '(1 2 3 4))) (print-line x))
1 3
it: null