Function
A compiler directive that tells the compiler it need not issue a warning if its argument is bound but not referenced.
ignorable variable => ()
None.
common-extensions
common-extensions
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.
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);