Make if forms compile directly to the appropriate branch expression if the test is a literal

Description

This allows expressions like `(cond (some-expr) 1 :else 2)` to be eligible for unboxed use, which is not currently possible since the cond macro always ends up with a nil else branch that the compiler currently takes into account.

With the attached patch, the trailing (if :else 2 nil) in the macroexpansion will be treated as 2 by the Compiler, thus allowing the unboxed usage of the cond expression.

Environment

None

Assignee

Unassigned

Reporter

Nicola Mometto

Approval

Triaged

Patch

Code

Priority

Minor
Configure