J3/02-161 To: J3 From: Dan Nagle Subject: Remove some restrictions on Optional Dummy Arguments Date: 9 Mar 02 During the discussion at 160 re arguments to IEEE module intrinsics, some unhelpful restrictions on non-present procedure arguments were encountered. Current constraints encourage the use of local variables in place of optional arguments, since the non-present argument can only appear as the argument of the present() intrinsic. Specifically, the following "natural" constructions are at present illegal: real( kind= myreal), optional :: foo ! note that foo's kind is known real( kind= kind( foo)) :: local_foo ! but foo might not be present ... opt_arg: if( present( foo) )then ! the only legal usage here local_foo = foo else opt_arg local_foo = 42.0_kind( foo) ! or huge( foo) etc. endif opt_arg ... ! use local_foo for the rest of the procedure Since the inquiry intrinsics do not query the value of their arguments, but only such compile time quantities as kind, and since there are reasonable uses of such information, a slight relaxation of the rules for non-present dummys is proposed. Specifically, the use of non-present dummys in compile time intrinsics should be allowed. I think this list is reasonably limited to: kind(), those listed in 13.5.6 Numeric Inquiry Functions, bit_size(). (I'll happily modify this list to meet J3's concerns.) Edits: (Edits are against 02-007, I'll update them to the r1 if this doesn't go down in flames before then :-) (Modify restrictions listed in 12.4.1.6) 258:15 Replace "PRESENT" with "PRESENT, KIND, BIT_SIZE or one of the Numeric Inquiry Functions (13.5.6)"