07-154 Date: 2007 February 05 To: J3 From: Dick Hendrickson Subject: Clause 3; rewrite macro note 3.15 References: J3/07-007 Rewrite of note 3.15 on page 42 to use macro assignment variables and the new kind selection arrays. Also change the generated function value to use the actual kind value. Replace the example text in note 3.15 with: DEFINE MACRO :: i_square_procs() MACRO INTEGER I, thiskind MACRO DO i=1, size(INT_KIND_VALUES) MACRO thiskind = INT_KIND_VALUES(i) FUNCTION i_square_kind_%%thiskind (a) RESULT(r) INTEGER(thiskind) a,r r = a**2 END FUNCTION MACRO END DO END MACRO Alternatively, f the kind arrays are not accepted, then just change the generated function name DEFINE MACRO :: i_square_procs() MACRO INTEGER I, thiskind, lastkind MACRO lastkind = SELECTED_INT_KIND(1) - 1 MACRO DO i=1,1000 MACRO thiskind = SELECTED_INT_KIND(i) MACRO IF (thiskind>=0 .AND. thiskind/=lastkind)) THEN FUNCTION i_square_kind_%%thiskind(a) RESULT(r) INTEGER(thiskind) a,r r = a**2 END FUNCTION MACRO END IF MACRO lastkind = thiskind MACRO END DO END MACRO