[J3] [EXTERNAL] Re: 21-120r2: Discussion on the feasibility of any future enhancement of Enumeration Type
Van Snyder
van.snyder at sbcglobal.net
Tue Mar 2 23:41:21 UTC 2021
The controversy concerning 21-120 illustrates that C ENUM was a bad
idea i the first place. Bill has it right.
Please think through what is being done. Do it right. Don't do half
measures. Doing nothing is better than adding a kludge that can't be
undone.
On Tue, 2021-03-02 at 21:44 +0000, Bill Long via J3 wrote:
> > On Mar 2, 2021, at 3:40 PM, Reuben D. Budiardja via J3 <
> > j3 at mailman.j3-fortran.org> wrote:
> > On 03/02/2021 01:11 PM, Ondřej Čertík via J3 wrote:
> > > 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 EnumContains Subroutine sub(a)
> > > Bind(C) Type(myenum),Value :: a Print *,a ! Acts as if it
> > > is Print *,Int(a). End SubroutineEnd ModuleWhy cannot we simply
> > > allow to drop the `bind(c)`, then we have an enumeration type
> > > that we can use?
> >
> > Because this does not satisfy the requirements for "true
> > enumerations types". The purpose of this one is to be better
> > interoperable with C enum.
>
> Additionally, I don’t see why the BIND(C) is harmful. You can put
> BIND(C) on lots of things that never end up interacting with C. It
> just enforces certain storage requirements.
> Cheers,Bill
>
> > > I do not think we should have two enumeration types in the
> > > language.
> >
> > The way I see it, there will only be one enumeration type in 202X.
> > This is 21-120r2. 21.110 is / should be really part of the
> > interoperability with C.
> > Best,Reuben
> >
>
> Bill
> Long
> longb at hpe.com
> Engineer/Master , Fortran Technical Support & voice: 651-605-
> 9024Bioinformatics Software
> Development fax: 651-605-9143Hewlett Packard
> Enterprise/ 2131 Lindau Lane/ Suite 1000/ Bloomington, MN 55425
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20210302/166bcca6/attachment.htm>
More information about the J3
mailing list