comp.lang.ada
 help / color / mirror / Atom feed
From: "Nasser M. Abbasi" <nma@12000.org>
Subject: does modern Fortran have membership test similar to this Ada 2012 feature?
Date: Tue, 19 Jun 2012 07:37:18 -0500
Date: 2012-06-19T07:37:18-05:00	[thread overview]
Message-ID: <jrprpv$d6q$1@speranza.aioe.org> (raw)


Fortran experts:

I do not know Fortran well. I did google search, but too many
false hits due to the nature of the search.

I thought I ask here, since someone who is an expert in the language
would know right away the answer to this question without any effort.

Does Fortran have set membership test? Similar to this
description below, I copied from 2012 Ada introduction by
John Barnes.

-- start quote ------

In previous versions of Ada, membership tests allowed one
to see whether a value was in a range or in a subtype, thus
we could write either of

       if D in 1 .. 30 then

       if D in Days_In_Month then

but we could not write something like

          if D in 1 | 3 | 5 | 6 ..10 then

This is now rectified and following "in" we can now have one
or more of a value, a range, or a subtype or any
combination separated by vertical bars. Moreover, they do
not have to be static.

----- end quote ----------------

Any thing like the above build-in Fortran 90, 2003, etc...

ofocurse one can write a function to do the above, but
wanted to check if it is build in. Syntax is not important,
just the concept.

thanks,
--Nasser
ps. I added comp.lang.ada, just FYI, and may be someone there
might know also.



             reply	other threads:[~2012-06-19 12:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-19 12:37 Nasser M. Abbasi [this message]
2012-06-19 16:34 ` does modern Fortran have membership test similar to this Ada 2012 feature? Ron Shepard
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox