[J3] 21-120r2: Discussion on the feasibility of any future enhancement of Enumeration Type

Ondřej Čertík ondrej at certik.us
Tue Mar 2 18:11:12 UTC 2021


Hi,

The paper https://j3-fortran.org/doc/year/21/21-110r1.txt is extending the enum type, here is an example syntax (from the paper):

Module enum_mod
  Enum,Bind(C) :: myenum
    Enumerator :: one=1, two, three
  End Enum
  Enum,Bind(C) :: flags
    Enumerator :: f1 = 1, f2 = 2, f3 = 4
  End Enum
Contains
  Subroutine sub(a) Bind(C)
    Type(myenum),Value :: a
    Print *,a ! Acts as if it is Print *,Int(a).
  End Subroutine
End Module


Why cannot we simply allow to drop the `bind(c)`, then we have an enumeration type that we can use? 

I do not think we should have two enumeration types in the language.

Ondrej


More information about the J3 mailing list