(j3.2006) Unlimited polymorphic and LOCK_TYPE (and EVENT_TYPE)
Bill Long
longb
Tue Jun 3 12:16:41 EDT 2014
Ultimately, I think this discussion arises from the sentence ?A scalar variable of type EVENT_TYPE is an event variable.? since the subsequent discussions are all about event variables. The key requirement is that the type referred to here is the *declared* type and not the dynamic type. Eventually you can deduce this since later constraints on event variables would not work for dynamic types. It might be easier to remove the puzzle-solving requirement and up front say ?declared type? in the sentence above -> ?A scalar variable of declared type EVENT_TYPE is an event variable.?.
Cheers,
Bill
On Jun 2, 2014, at 7:04 PM, Malcolm Cohen <malcolm at nag-j.co.jp> wrote:
> Hi Bill,
>
> Interesting new example....
>
>> class(*),allocatable :: myevent[:]
>> ?
>> allocate (event_type :: myevent[*] )
>
> I don't offhand see any problem with this code, even without MYEVENT being a
> coarray, but then again it also does not achieve anything. The only way you can
> achieve anything is to follow it up with something like
>
> SELECT TYPE (letter=>myevent) ! Renaming merely for exposition.
> TYPE IS (event_type)
> POST letter
>
> at which point my previous reasoning comes into play: the construct entity
> LETTER is declared to be of type EVENT_TYPE and is therefore required to be a
> coarray; in your example it is (construct entities have the same corank and
> cobounds as the selector), so the code would be ok. If myevent were not a
> coarray, the ALLOCATE would be ok (as in, would not fail any current constraint)
> but any attempt to actually use it as an event variable is inevitably going to
> run afoul of the "required to be a coarray" constraint.
>
> That is certainly what we would seem to have for LOCK_TYPE. It could be argued
> that this was unintentional (since it is useless) and that therefore we ought to
> have had a constraint on it in F2008. That would be interp fodder if so. For
> EVENT_TYPE we are not constrained by what we did in F2008 but for consistency it
> is probably good to make it similar to LOCK_TYPE except in so far as it is
> different because it is an event not a lock.
>
> Cheers,
> --
> ................................Malcolm Cohen, Nihon NAG, Tokyo.
>
> _______________________________________________
> J3 mailing list
> J3 at mailman.j3-fortran.org
> http://mailman.j3-fortran.org/mailman/listinfo/j3
Bill Long longb at cray.com
Fortran Technical Suport & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9142
Cray Inc./ Cray Plaza, Suite 210/ 380 Jackson St./ St. Paul, MN 55101
More information about the J3
mailing list