Next Previous Up Top Contents Index

2.6 The COMMON-EXTENSIONS module

ignorable

Function

Summary

A compiler directive that tells the compiler it need not issue a warning if its argument is bound but not referenced.

Signature

ignorable variable => ()

Arguments

variable
A Dylan variable-namebnf.

Values

None.

Library

common-extensions

Module

common-extensions

Description

When the compiler encounters a variable that is bound but not referenced, it normally issues a warning. The ignorable function is a compiler directive that tells the compiler it need not issue this warning if variable is bound but not referenced. The ignorable function has no run-time cost.

The ignorable function is useful for ignoring arguments passed to, or values returned by, a function, method, or macro. The function has the same extent as a let; that is, it applies to the smallest enclosing implicit body.

The ignorable function is similar to ignore. However, unlike ignore, it does not issue a warning if you subsequently reference variable within the extent of the ignorable declaration. You might prefer ignorable to ignore if you are not concerned about such violations and do not wish to be warned about them.

Example

This function ignores some of its arguments:

define method foo (x ::<integer>, #rest args)
  ignorable(args);
  ...
end

Here, we use ignorable to ignore one of the values returned by fn:

let (x,y,z) = fn();
ignorable(y);

See also

ignore, page 32


Common Dylan and Functional Extensions - 31 Mar 00

Next Previous Up Top Contents Index