[J3] conditional-arg and the handling of additional (expr) parens

Johnson, Ted tedj at hpe.com
Tue Mar 10 19:48:22 UTC 2026


I'm trying to understand the impact of adding some wrapping parens to create an expr, within the context of conditional arguments.

I believe something like this should be rejected - attempting to turn .NIL. into an expr, or trying to turn the whole conditional-arg into an expr. Yes, or no?

call foo( ((cond ? (X) : (.NIL.))) )

I don't see how ((.NIL.)) could ever be correct based on 25-007r1.

Also I wanted to see if "C1535 An actual-arg that is an expr shall not be a variable or a conditional-arg" was intended to prevent converting a whole conditional-arg into an expr.

Since a bare ((.NIL.)) doesn't appear to be valid , I would assume call foo( (( .true. ? .NIL. : X)) ) hits up against C1535 as well. If not, why?

Thanks.

-ted



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20260310/7b679c21/attachment.htm>


More information about the J3 mailing list