We're updating the issue view to help you get more done. 

Thread predicate-induced inference through and

Description

If you have an expression like

1 (and (string? x) (zero? (count x)))

then, if the first argument to and is satisfied, we know that x must be a string, and we can carry that through to the subsequent arguments to and.

In particular, in the example above, the count intrinsic should be enabled and the JavaScript generated should involve a direct access on the length field as opposed to a call to count:

1 typeof x === "string" && x.length === 0;

Environment

None

Status

Assignee

Mike Fikes

Reporter

Mike Fikes

Labels

None

Approval

Accepted

Patch

Code and Test

Priority

Major