If the key or value pattern of a <code>for</code> loop does not match, then the loop simply skips that element of the collection. This can be useful, but is unlike all other non-explicit pattern match operations (<code>def</code> and parameter lists).

For-loop pattern failure is not an error

If the key or value pattern of a for loop does not match, then the loop simply skips that element of the collection. This can be useful, but is unlike all other non-explicit pattern match operations (def and parameter lists).

def x doesn't return x

The forward declaration expression, def var, does not return var but rather the Resolver for it.

Examples

# E sample
? def x
# value: <Resolver>
? x
# value: <Promise>

Rationale

If you want to pass a resolver as an argument, using it as an “out parameter”, this syntax is helpful:

x.hereIsAResolver(def y)
... use y

Alternative

If you want the actual promise, simply write (def x; x).

Unresolved references do not necessarily behave as their future resolved identity

— messages sent before the reference is resolved may be reacted to however the current holder of the reference “arrow-head” chooses, which does not necessarily correspond to the reference to which the unresolved reference resolves.

Rationale

Examples

Alternative

To avoid being vulnerable to this type of misbehavior, do not use a sameness test (==) or Map key lookup in order to decide on the reliability of the response to a previously sent message. This might involve using a when-catch/whenResolved construct to wait until the reference is resolved.

Accumulator operator is lowest-precedence

As you can see in the following expansion, the operator following the “_” is always lowest-precedence (as it is the one effectively rewritten into an assignment form):