## 8.1 Changes in Oz, Mozart libraries and UI

### 8.1.1 Loops

* patterns are now supported:

  > `for X#Y in L do ... end`

* iterator expressions with a bit of a C-flavor are supported:

  > `for X in Init;Cond;Next do ... end`

  for example:

  > `for I in 1;I<5;I+1 do ... end`

  also iterators of the form `E1..E2`, `E1..E2;E3`, `E1;E3` as before.

* nullary `break` and `continue` procedures can be obtained using loop features, e.g:

  > `for break:B X in L do ...{B}... end`

* EXPERIMENTAL: loops can be used as expressions using a hidden accumulator, e.g.:

  > `{Show
  > for collect:C
  > L in Ls
  > do
  > for X in L do
  > if {IsOdd X} then {C X} end
  > end
  > end}`

  This experimental facility uses loop features `collect`, `append`, `prepend`, `minimize`, `maximize`, `count`, `sum`, `multiply`, `return`, `default`. For more information check the documentation (``Loop Support'').

### 8.1.2 ``Failed'' Futures and Module Manager

- `{Value.byNeedFail E ?V}` binds `V` to the new notion of a ``failed future''. Any attempt to synchronize on `V` raises `E` as an exception.

- The module manager was updated to use ``failed futures'': when a module cannot be successfully linked its value becomes a failed future (instead of a record) which raises the exception which caused linking to fail each time the module is subsequently accessed. Thus, programmers have a chance of catching and recovering from linking errors.

### 8.1.3 Spaces

- `Space.askVerbose` returns `suspended` rather than `blocked`

- An exception is raised, if the argument to `Space.commit` refers to a non-existing alternative

- The control condition for application of space operations have been unified and extended, see the documentation

- `Space.kill` kills a space by injecting fail into it

A full treatment of spaces is available in the Christian Schulte's doctoral dissertation "Programming Constraint Services", from the Mozart publications page.

### 8.1.4 Distribution Subsystem

- The Oz programmer interface to the distributed subsystem has been extended. Parameters like buffer size and timeouts can now be specified at runtime.

- The family of tools for monitoring the behavior of the Mozart system has been extended with a new member, the Distribution Panel. The tool displays information about known remote Mozart sites, amount of communication, measured round-trip and exported/imported entities. Possibilities to remotely monitor other Mozart processes does also exist.

### 8.1.5 Constraint Systems

Constraint systems (finite domains, finite sets) have undergone, as usual, various improvements and bug fixes. Check the documentation.

### 8.1.6 Port Improvements

- Ability to send from a subordinated space to a superordinated space (provided that no local variables and names are referred to).

- SendRecv does a send and returns an answer. For details, see doc. This again works across spaces.

### 8.1.7 Pickling Format

Unfortunately, old pickles cannot be read by this new system. We do plan to have a generic conversion tool, but face a lack of human resources.

### 8.1.8 `ozl --rewrite'

The Oz linker (ozl) now supports a new command-line option, `--rewrite', which allows to transform the import URLs used by the output functor. Check the documentation for details.