comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov>
Subject: Re: Preferred method for bringing in operators
Date: 03 Jul 2001 16:21:36 -0400
Date: 2001-07-03T20:38:21+00:00	[thread overview]
Message-ID: <uae2ln4q7.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: 9ht50b$dk6$1@nh.pace.co.uk

"Marin David Condic" <marin.condic.auntie.spam@pacemicro.com> writes:

> Yeah. That generates some ideas at least. Out of all the possible
> approaches, this is one of them! :-)
> 
> I'm dealing basically with a tagged record and working from the polymorophic
> approach. Its not that I don't like generics - its just that in this case I
> want to be able to keep extending the classes to have new features as the
> need arises & generics tend to be less amenable to this. Besides, from
> looking at your generic example, I can see what I dislike about the
> approach - the need to build long lists of generic formal parameters and the
> difficulty this implies for the end-user. It has its advantages in many
> cases, but I'd like to avoid it if possible. Still, if all I want is to get
> a user defined "<" operator, this isn't so bad. I'm just not sure that it is
> the "Object Oriented Ada Way" - or at least a way that one won't regret as
> one uses and extends the package.

The polymorphic tagged type approach is definitely the "Class Oriented
Way". I think the pure generic approach defines equally good
"Objects"; they just aren't "Classes".

> On another matter: It looks like you're doing some things similar to
> things I have attempted - deriving tagged types from
> Ada.Finalization.Controlled. I'm using Gnat 3.13p and have had
> trouble mixing this with various stream operations. (What would
> appear to be legal & workable when it *doesn't* derive from
> Finalization ends up crashing when it *does* derive from
> Finalization.) I'm wondering if you have experienced similar
> troubles and if so did you find a workaround? 

No, I have not played with Streams much. I do play with storage pools,
and had trouble with GNAT 3.13 on that (3.14 fixes it).

> Are there other Ada compilers on which this may have worked
> properly?

I tested an early version of this stuff on ObjectAda, and had no
problems. But I've given up on that, partly because it doesn't have 64
bit ints, partly because GNAT has way better error messages, but
mostly because I don't have time to do both.

-- 
-- Stephe



  reply	other threads:[~2001-07-03 20:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-03 15:16 Preferred method for bringing in operators Marin David Condic
2001-07-03 17:49 ` Stephen Leake
2001-07-03 19:04   ` Marin David Condic
2001-07-03 20:21     ` Stephen Leake [this message]
2001-07-03 23:04     ` tmoran
2001-07-05 14:04       ` Marin David Condic
replies disabled

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