comp.lang.ada
 help / color / mirror / Atom feed
* OT:  F2K Type Extensions and "SELECT TYPE"
@ 2002-03-31 21:45 Gary Scott
  0 siblings, 0 replies; only message in thread
From: Gary Scott @ 2002-03-31 21:45 UTC (permalink / raw)


Hi,

Sorry this is off topic, I just wanted to get another perspective on
this.

Fortran 2k is implementing extensible derived types and a "select type"
statement.  As part of the construct, it uses TYPE IN and TYPE IS as in:

type, extensible :: point
   real :: x, y
end type point

type, extends(point) :: point_3d
   real :: z
end type point_3d

type, extends(point) :: color_point
   integer :: color
end type color_point

type(point), target :: p
type(point_3d), target :: p3
type(color_point), target :: c

class(point), pointer :: p_or_c

p_or_c => c

select type (a => p_or_c)
   type in (point)
      ...
   type is (point_3d)
      ...
end select

This is fairly straightforward except that I think the names TYPE IN and
TYPE IS can be improved to convey the selection criteria/concept better
to non-OO type engineers (possibly "TYPE IN_SET" or "TYPE IS_IN_SET" and
"TYPE SAME".  

Any recommendations?  Happy with it the way it is?  

As long as we're creating a new language, may as well get it right
(meaning adequately conveying the meaning to those language users that
are definitely going to be overwhelmingly "procedural" in their thought
process and will want to learn to use OO over time).

Thanks

-- 

Gary Scott
mailto:scottg@flash.net



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-03-31 21:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-31 21:45 OT: F2K Type Extensions and "SELECT TYPE" Gary Scott

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