Next Previous Up Top Contents Index

2.6 The COMMON-EXTENSIONS module

ignore

Function

Summary

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

Signature

ignore 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 ignore function is a compiler directive that tells the compiler it must not issue this warning if variable is bound but not referenced. The ignore function has no run-time cost.

The ignore 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.

Use ignore if you never intend to reference variable within the extent of the ignore. The compiler will issue a warning to tell you if your program violates the ignore. If you are not concerned about the ignore being violated, and do not wish to be warned if violation occurs, use ignorable instead.

Example

This function ignores some of its arguments:

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

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

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

See also

ignorable, page 33


Common Dylan and Functional Extensions - 31 Mar 00

Next Previous Up Top Contents Index