Language Syntax

Generic Preprocessor


There are many cases in which the same algorithm may need to be implemented for several different data types. The generic preprocessor, in addition to SPP converts a generic procedure into a set of procedures specific to particular data types. We mention this briefly here and refer to a more detailed discussion in "Generic Preprocessor" on page 167 and help generic in the IRAF cl, which describe all of the preprocessor directives and the command used to process generic code. Many useful examples of generic procedures exist in IRAF, particularly in the vops package, a library of generic procedures dealing with vector operations implemented for the SPP data types. See "Vector (Array) Operators -- vops" on page 103 for a description of this package. To indicate the flavor of this facility, here is an example of generic code from the vops package:



The generic preprocessor will replace the $t suffix on the procedure name by the single character initial of the data type (s, i, etc.). The preprocessor directive PIXEL is replaced by the appropriate data type declaration (short, int, etc.).


Generated with CERN WebMaker