[J3] [EXTERNAL] [BULK] Re: Consistency in conversion functions

Vipul Parekh parekhvs at gmail.com
Tue Apr 4 20:37:55 UTC 2023


On Tue, Apr 4, 2023 at 3:09 PM Jeff Hammond via J3 <
j3 at mailman.j3-fortran.org> wrote:

>
> On 4. Apr 2023, at 21.59, Van Snyder via J3 <j3 at mailman.j3-fortran.org>
> wrote:
>
> Every new intrinsic procedure inserts a new opportunity for conflict with
> existing codes.
>
> Do you have any evidence that codes are defining procedures named
> INTEGER() that take the same arguments as INT() or that any programmer has
> ever thought it was a good idea to name a procedure the same as a language
> intrinsic type?
>
> Fortran has no reserved names and yet somehow the language has managed to
> evolve without the world coming to an end. The possibility of theoretical
> problems isn’t a reason to refuse to solve real problems.
>


What conflict?  Isn't the INTRINSIC statement semantics in the standard to
help prevent a conflict?

   block
      print *, "Block 1: using user's real"
      print *, real(42)
   end block
   print *
   blk2: block
      intrinsic :: real
      print *, "Block 2: using intrinsic real"
      print *, real(42)
   end block blk2
contains
   function real( a ) result(r)
      integer, intent(in) :: a
      real :: r
      r = a + 1
   end function
end

* program response
C:\temp>p.exe
 Block 1: using user's real
  43.0000000

 Block 2: using intrinsic real
  42.0000000

Vipul Parekh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20230404/b5c63c53/attachment.htm>


More information about the J3 mailing list