comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@bix.com
Subject: Re: Extending Nested Tagged Records
Date: 1999/12/06
Date: 1999-12-06T00:00:00+00:00	[thread overview]
Message-ID: <6nW24.159$is.27426@typhoon-sf.snfc21.pbi.net> (raw)
In-Reply-To: 84E639D0D9829A88.356169F32CD3866A.7936C8200D458BB1@lp.airnews.net

>type telemetry_type is tagged  ...
>
>type motorized_device is tagged record
>          telemetry: telemetry_type;   -- this is what I want to extend
>...
>type device_1 is new motorized_device with
>...
  So the telemetry module is not a black box, but may have some things
added when it's in a device_1 or different things when it's in a device_2?
One approach is to change "telemetry_type" to "basic_telemetry_type",
indicating that it's the rock bottom minimum that any motorized_device
contains, and then have add-ons like
  type device_1 is new motorized_device with
    extra_telemetry : ...

Alternatively, drop telemetry entirely from "motorized_device" and instead
put appropriate kinds of telemetry in different devices.
  type telemetry_type_1 is new telemetry_type with ... -- used in device_1
  type telemetry_type_2 is new telemetry_type with ... -- used in device_2
  type device_1 is new motorized_device with
    telemetry : telemetry_type_1;
    ...

You could of course include an "access telemetry_type'class" instead
of a "telemetry_type" in motorized_device, and then install the
appropriate kind in each kind of device.  That would also let you
have an arbitrary telemetry package in each device type - which
perhaps you don't want.

What are you trying to accomplish?




  reply	other threads:[~1999-12-06  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-06  0:00 Extending Nested Tagged Records Robert B. Love 
1999-12-06  0:00 ` tmoran [this message]
     [not found] <84E639D0D9829A88.356169F32CD3866A.7936C8200D458BB1@lp.airnews. net>
1999-12-06  0:00 ` Matthew Heaney
replies disabled

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