John Harper suggested:
> Could we solve the problem by having a new intrinsic perhaps called CMPLEX
that is fully generic, as well as the existing CMPLX, which isn't?
This certainly has had some support in the past, and some people attempted
to draft concrete proposals for it (it was a public comment on Fortran
2008). However, as you note in your later message there are some
complications, and these resulted in the proposal being dropped at that
time. And not revived later. I think it is possible to design a better
COMPLEX constructor, so it is worth looking at the issues again. Based on
past experience it will need some careful design work if it is to have any
chance of achieving consensus though!
Cheers,
--
..............Malcolm Cohen, NAG Oxford/Tokyo.
On Fri, 2 Jun 2017, Malcolm Cohen wrote:
> Date: Fri, 2 Jun 2017 17:30:08 +0900
> From: Malcolm Cohen <[log in to unmask]>
> Reply-To: Fortran 90 List <[log in to unmask]>
> To: [log in to unmask]
> Subject: Re: Features for the next Fortran Standard (following Fortran
> 2015)
>
>> The proposal does not invalidate any old programs.
>
> Unfortunately it does, it invalidates programs going all the way back
> to Fortran 77.
>
>> And some users could well find that their programs begin giving
> more-accurate results !! because they did not use CMPLX correctly (and
> inadvertently had their double-precision values quietly converted to
> single precision).
>
> And other users could well find their programs failing to compile,
> giving incorrect results, or crashing at runtime because they are now
> passing things twice as big as before, but the receiver is not expecting
that.
>
>> The inadequacy of the existing CMPLX has caught professionals.
>
> Which is precisely why I wrote:
>>> You might find it easier to use a compiler that warns you when
>>> you've apparently forgotten to use the KIND argument of CMPLX.
>
> Such compilers are in fact available.
>
> Cheers,
> --
> ........................Malcolm Cohen, NAG Oxford/Tokyo.
>
-- John Harper, School of Mathematics and Statistics
Victoria University, PO Box 600, Wellington 6140, New Zealand
e-mail [log in to unmask] phone (+64)(4)463 5276 fax (+64)(4)463 5045
|