I had a mildy wild idea: can you define a user-defined operator that actually takes three arguments? Obviously, not directly, but an operator that clips a value between two bounds could look like:
y = x .clip. [0.0, 2.0]
This works (see example code) with gfortran and flang. But ifx protests:
Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version 2025.0.0 Build 20241008
Copyright (C) 1985-2024 Intel Corporation. All rights reserved.
triple.f90(32): error #6535: This variable or component must be of a derived or structure type. [X]
write(*,*) x .clip. [0.0, 2.0]
Quite probably due to the support of a non-standard style of defining structures and the like, but my question is: is this standard complying?
triple.f90 (697 Bytes)