comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@bix.com
Subject: Re: C/C++ programmer giving Ada95 a chance -- writing an emulator.
Date: 2000/03/31
Date: 2000-03-31T00:00:00+00:00	[thread overview]
Message-ID: <2YSE4.251$sy6.25957@news.pacbell.net> (raw)
In-Reply-To: 38E3DBD7.27F5B246@acenet.com.au

>And the conversion to Op_Root'Class to force dispatching
>seems reasonable to me (you can find this on p546 of Cohen).
  On p546 Cohen says:

> Given (the declaration File_Name_Copy : Heirarchical_File_Name;)
> if we were to replace the statement
>
> This_Delimiter := Delimiter(File_Name'Class(File_Name));
>   (he presumably meant to say:
> This_Delimiter := Delimiter(Heirarchical_File_Name_Type'Class(File_Name));
>   )
>
>    with
>
> File_Name_Copy := File_Name;
> This_Delimiter := Delimiter(Heirarchical_File_Name_Type'Class(File_Name_Copy));
>
> the call on Delimiter would no longer redispatch based on the
> tag of File_Name.  The assignment to File_Name_Copy throws away
> the tag of File_Name, and the call on Delimiter always dispatches
> to the Heirarchical_File_Name_Type version of the function.

I believe that your assignment

>    Op_Table : array (Opcode) of Op_Root
>     := (Op_Root (O0),
>         Op_Root (O1),
>        etc
likewise throws away the tags of the things copied into spots in
Op_Table, and the call on
>       Func (Op_Root'Class (Op_Table (IR)));
always dispatches to the Op_Root version of the function.
  I think we have here both an error in Gnat and an error in
Cohen's book!

> It is also obvious my code wouldn't work if the derived types
> added components.
Exactly.




       reply	other threads:[~2000-03-31  0:00 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <38E3DBD7.27F5B246@acenet.com.au>
2000-03-31  0:00 ` tmoran [this message]
2000-03-31  0:00   ` C/C++ programmer giving Ada95 a chance -- writing an emulator Geoff Bull
2000-04-01  0:00     ` Tucker Taft
2000-04-02  0:00       ` Geoff Bull
2000-04-02  0:00       ` Robert Dewar
2000-04-02  0:00         ` Geoff Bull
     [not found] <38e148e2.5089627@news.shreve.net>
2000-03-28  0:00 ` Ken Garlington
2000-03-28  0:00 ` Geoff Bull
2000-03-28  0:00   ` Jean-Marc Bourguet
2000-03-28  0:00 ` Juergen Pfeifer
2000-03-28  0:00   ` Jim Rogers
2000-03-29  0:00     ` Ed Falis
2000-03-29  0:00       ` James S. Rogers
2000-03-29  0:00         ` Jean-Marc Bourguet
2000-03-29  0:00         ` Robert Dewar
2000-03-30  0:00         ` Geoff Bull
2000-03-30  0:00           ` tmoran
2000-04-01  0:00           ` Robert Dewar
     [not found] ` <38e19656.17008608@news.shreve.net>
2000-03-29  0:00   ` Marc A. Criley
2000-03-29  0:00   ` David Starner
2000-03-29  0:00     ` Robert Dewar
2000-03-29  0:00       ` Jean-Marc Bourguet
2000-03-29  0:00         ` Robert Dewar
2000-03-30  0:00           ` Jean-Marc Bourguet
2000-04-01  0:00             ` Robert Dewar
2000-03-29  0:00       ` Marin D. Condic
2000-03-29  0:00         ` Robert A Duff
2000-03-29  0:00           ` Marin D. Condic
2000-03-30  0:00       ` Geoff Bull
2000-04-01  0:00         ` Robert Dewar
2000-04-02  0:00           ` Geoff Bull
2000-04-02  0:00             ` Robert Dewar
2000-04-02  0:00             ` swhalen
2000-03-29  0:00     ` Robert A Duff
2000-03-30  0:00       ` Geoff Bull
2000-04-01  0:00         ` Robert Dewar
2000-03-29  0:00   ` swhalen
2000-03-29  0:00     ` Robert Dewar
2000-03-30  0:00       ` swhalen
2000-03-29  0:00   ` Marin D. Condic
2000-03-30  0:00   ` Ken Garlington
2000-03-30  0:00   ` Samuel T. Harris
2000-04-01  0:00     ` Robert Dewar
2000-04-05  0:00       ` Robert A Duff
2000-03-30  0:00 ` Geoff Bull
     [not found]   ` <38e7e951.8384503@news.shreve.net>
2000-04-02  0:00     ` Jean-Pierre Rosen
2000-04-02  0:00       ` Robert Dewar
2000-04-03  0:00         ` Paul Graham
2000-04-06  0:00           ` Robert Dewar
2000-04-06  0:00             ` Larry Kilgallen
2000-04-06  0:00               ` Robert Dewar
2000-04-06  0:00                 ` Gautier
2000-04-07  0:00                   ` Robert Dewar
2000-04-07  0:00                     ` Gautier
replies disabled

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