# Humus Overview

### THROW

The form ‘THROW expression‘ throws an exception with the value of expression. If an actor behavior throws an exception, all concurrent activities performed by the behavior have no effect. The current message is discarded and subsequent messages are processed with the current behavior.

### Block Expressions

If an expression is encountered where a statement is expected, the expression is evaluated to produce a block value. The block is then executed in parallel with all other statements. Each block defines a nested scope for identifiers.

## Conditionals

Conditionals are expressions that select values based on pattern matching. They are often used in statement contexts to produce blocks for conditional execution.

### IF … ELIF … ELSE …

The form ‘IF equation expression‘ tries to resolve the pattern matching equation, possibly resulting in variable bindings, as with LET. If the match succeeds, the expression is evaluated in the context of these new bindings. If the match fails, the value is undefined?‘. The form ‘IF equation expression1 ELSE expression2‘ evaluates expression2, without any new bindings, if the equation fails to match. The form ‘IF equation1 expression1 ELIF equation2 expression2 ...‘ tries each equation in sequence, evaluating the expression corresponding to the first match, or the optional ELSE clause if there is no match.

### CASE … OF … END

In the common case of matching a value against multiple patterns, CASE may be more expressive. The form ‘CASE value OF pattern:expression ... END‘ attempts to match the value with each pattern in sequence, evaluating the expression corresponding to the first match. As with IF, the expression is evaluated in a context with any new bindings established by the matching pattern. The pattern ‘_‘ matches any value and introduces no bindings, so it can be used like an ‘ELSE‘ clause.