comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: 'withing' problem
Date: 15 Nov 2001 20:21:33 +0000
Date: 2001-11-15T20:21:39+00:00	[thread overview]
Message-ID: <x7vu1vv6b02.fsf@smaug.pushface.org> (raw)
In-Reply-To: tv55kecu56i1f@corp.supernews.com

"Matthew Heaney" <mheaney@on2.com> writes:

> "Simon Wright" <simon@pushface.org> wrote in message
> news:x7vy9lbxih0.fsf@smaug.pushface.org...
> > I think that people looking at this model, perhaps for the purpose of
> > maintaining code written to implement it, need to have a very clear
> > idea of how the code will look.
> 
> My philosophy is, if you want to have a good idea how the code will look,
> then you should look at the code...  In any case, you should just ignore the
> forward declaration package, as it's just syntactic overhead that has no
> bearing on your model of the problem.
> 
> > It's a Bad Thing if you need to make arbitrary decisions to break
> > cycles.
> 
> You haven't explained why arbitrary decisions are bad, so this isn't a very
> cogent argument, which just reduces to "I don't like it, so it's bad."

Well, "arbitrary" translates roughly to "unpredictable", "surprising"
both of which are definitely bad (I think so, anyway).

> And besides, this solution is no different from other areas of the language.
> For example, if you want to declare a recursive pair of subprograms, then
> you have to forward declare one of them (and it's arbitrary which one):

Here, you can "arbitrarily" (or following the warnings given by
-gnaty) forward declare _both_ (ie, _all_) subprograms. Symmetric.

> > What would be even worse would be to have a framework code generator
> > that applied heuristics to break cycles. I imagine that it wouldn't
> > take much for such heuristics to make the opposite decision for minor
> > model changes (remember that very few models are as simple as this
> > one!)
> 
> Let's concentrate on real problems.  John Volan couldn't figure out
> how to declare two mutually dependent abstractions in two separate
> packages.  I showed how to do this.  Problem solved.

This topic is a real problem for me.


Does your Patient_Forward solution extends to declaring Doctor_Forward
similarly? I get trouble at

   procedure Visit_Doctor
     (Patient : in out Patient_Type;
      Doctor  : in out Root_Doctor'Class) is
   begin
      Treat_Patient (Doctor, Patient);
patients.adb:9:22: expected type "Doctor_Type" defined at doctors.ads:6
patients.adb:9:22: found type "Root_Doctor'Class" defined at doctors_forward.ads:3
   end;




  reply	other threads:[~2001-11-15 20:21 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-02 10:24 'withing' problem David Crocker
2001-11-02 10:58 ` David C. Hoos, Sr.
2001-11-02 21:32   ` Florian Weimer
2001-11-02 14:49 ` Robert Dewar
2001-11-05  9:49   ` David Crocker
2001-11-02 15:06 ` Wes Groleau
2001-11-02 15:21 ` Ted Dennison
2001-11-02 17:19   ` Ed Falis
2001-11-02 18:17     ` Preben Randhol
2001-11-02 19:15       ` Ed Falis
2001-11-03  2:52       ` DuckE
2001-11-03  9:50         ` Preben Randhol
2001-11-03  8:25   ` Simon Wright
2001-11-03 17:27     ` Richard Riehle
2001-11-04 10:23       ` Simon Wright
2001-11-08 10:58         ` Preben Randhol
2001-11-08 15:24           ` Peter Hend�n
2001-11-10 17:57           ` Simon Wright
2001-11-05  9:48       ` David Crocker
2001-11-05 20:36         ` Ted Dennison
2001-11-06 15:56           ` David Crocker
2001-11-07 15:06             ` Ted Dennison
2001-11-07 16:49               ` Darren New
2001-11-09 20:28         ` Matthew Heaney
2001-11-10 13:55           ` Preben Randhol
2001-11-12 15:10             ` Matthew Heaney
2001-11-10 18:12           ` Simon Wright
2001-11-12 15:13             ` Matthew Heaney
2001-11-13  7:01               ` Simon Wright
2001-11-14 16:10                 ` Matthew Heaney
2001-11-15 20:21                   ` Simon Wright [this message]
2001-11-15 21:07                     ` Matthew Heaney
2001-11-16 14:37                     ` Stephen Leake
2001-11-17 22:29                     ` Richard Riehle
2001-11-18 14:53                       ` Simon Wright
2001-11-19  5:51                         ` Simon Wright
2001-11-19 15:23                         ` Matthew Heaney
2001-11-19 17:19                           ` 'withing' problem [code generation] Mark Johnson
2001-11-19 20:58                             ` Stephen Leake
2001-11-19 21:20                               ` Matthew Heaney
2001-11-21  6:20                                 ` Simon Wright
2001-11-20  0:50                               ` Mark Biggar
2001-11-21  6:21                                 ` Simon Wright
2001-11-20 14:42                               ` Mark Johnson
2001-11-20 16:34                                 ` David Crocker
2001-11-20 18:34                                   ` Richard Pinkall-Pollei
2001-11-20 18:43                                   ` Matthew Heaney
2001-11-20 20:37                                     ` Mark Lundquist
2001-11-22 11:49                                     ` David Crocker
2001-11-20 20:35                                   ` Mark Lundquist
2001-11-22 11:42                                     ` David Crocker
2001-11-19 19:30                           ` 'withing' problem Preben Randhol
2001-11-03  8:26 ` Simon Wright
2001-11-03  8:38 ` Simon Wright
2001-11-05  9:54   ` David Crocker
2001-11-05 18:04     ` tmoran
2001-11-06 15:29       ` David Crocker
2001-11-07  0:38         ` tmoran
2001-11-07 10:11           ` David Crocker
2001-11-07 18:59             ` tmoran
2001-11-08 11:38               ` David Crocker
2001-11-10 18:03                 ` Simon Wright
replies disabled

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