| | 1 | = Generate function specification = |
| | 2 | |
| | 3 | The “generate function specification” transformation calculates the specification of the selected function and insert the -spec directive in front of the function. |
| | 4 | |
| | 5 | Inserting specification for function {{{f}}}: |
| | 6 | |
| | 7 | {{{ |
| | 8 | j(X, ok) -> |
| | 9 | X + 2. |
| | 10 | }}} |
| | 11 | |
| | 12 | Result: |
| | 13 | |
| | 14 | {{{ |
| | 15 | -spec(j(float()|int(),atom()) |
| | 16 | ->float()|int()) |
| | 17 | |
| | 18 | j(X, ok) -> |
| | 19 | X + 2. |
| | 20 | }}} |
| | 21 | |
| | 22 | == Side conditions == |
| | 23 | |
| | 24 | * There is no side condition to use this transformation. |
| | 25 | |
| | 26 | |
| | 27 | == Transformation steps and compensations == |
| | 28 | |
| | 29 | 1. Calculates the specification of the function. |
| | 30 | |
| | 31 | 2. Inserts the specification. |