Next Previous Up Top Contents Index

2.6 The COMMON-EXTENSIONS module

when

Statement macro

Summary

Executes an implicit body if a test expression is true, and does nothing if the test is false.

Macro call

when (test) [ consequent ] end [ when ]

Arguments

test
A Dylan expressionbnf.

consequent
A Dylan bodybnf.

Values

Zero or more instances of <object>.

Library

common-extensions

Module

common-extensions

Description

Executes consequent if test is true, and does nothing if test is false.

This macro behaves identically to Dylan's standard if statement macro, except that there is no alternative flow of execution when the test is false.

Example

when (x < 0)
  ~ x;
end;

Common Dylan and Functional Extensions - 31 Mar 00

Next Previous Up Top Contents Index