Next Previous Up Top Contents Index

4.11.1 An extended form of conditional-update!

conditional-update!

Statement macro

Summary

Performs an atomic test-and-set operation.

Macro call

conditional-update!(local-name = place) 
body
[success success-expr]
[failure failure-expr]
end

Arguments

local-name
A Dylan variable-namebnf.

place
A Dylan variable-namebnf or a function call.

body
A Dylan bodybnf.

Values

See Description.

Library

threads

Module

threads

Description

This extended form of conditional-update! additionally accepts a place that has the syntax of a call to a function. This extended form for conditional-update! is analogous to that for :=. In this case, if the place appears syntactically as

name(arg1, ... argn)

The macro expands into this call:

name-conditional-updater(new-value, local-name, arg1, ... argn)

If the result of this function call is #f, the conditional update is deemed to have failed.


Common Dylan and Functional Extensions - 31 Mar 00

Next Previous Up Top Contents Index