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/30
Date: 2000-03-30T00:00:00+00:00	[thread overview]
Message-ID: <iRNE4.153$sy6.23019@news.pacbell.net> (raw)
In-Reply-To: 38E2DC8A.45AE7226@research.canon.com.au

> Here's one way to use dispatching on tagged types ...
>    Op_Table : array (Opcode) of Op_Root
>     := (Op_Root (O0),
>         Op_Root (O1),
>         Op_Root (O2),
>         Op_Root (O3),
>         others => OU
>         );
>    ...
>       Func (Op_Root'Class (Op_Table (IR)));

> The main loop, on a sparc with gnat 3.12p -gnatp -O3, is 9 instructions
  It also works with Gnat 3.12p NT.  But both ObjectAda and Janus
print a series of "undefined opcode".  It seems to me that is
actually the correct behavior, since Op_Table is a table of Op_Root,
not a table of Op_Root'class.  I'd be inclined to report this as
a Gnat error.
  As alternatives, you might make Op_Table a table of
access-to-Op_Root'class or use a "case statement IR is".
The latter, of course, is explicitly what you were trying to avoid.

> I don't think it is any clearer or better than my original.
  Agreed.  It's slower, more complex, and, it seems to me, has
no benefits.




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

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <38e148e2.5089627@news.shreve.net>
2000-03-28  0:00 ` C/C++ programmer giving Ada95 a chance -- writing an emulator 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         ` Robert Dewar
2000-03-29  0:00         ` Jean-Marc Bourguet
2000-03-30  0:00         ` Geoff Bull
2000-03-30  0:00           ` tmoran [this message]
2000-04-01  0:00           ` Robert Dewar
2000-03-28  0:00 ` Ken Garlington
     [not found] ` <38e19656.17008608@news.shreve.net>
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-29  0:00   ` Marc A. Criley
2000-03-29  0:00   ` David Starner
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     ` 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-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-30  0:00       ` Geoff Bull
2000-04-01  0:00         ` Robert Dewar
2000-04-02  0:00           ` Geoff Bull
2000-04-02  0:00             ` swhalen
2000-04-02  0:00             ` Robert Dewar
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
     [not found] <38E3DBD7.27F5B246@acenet.com.au>
2000-03-31  0:00 ` tmoran
2000-03-31  0:00   ` Geoff Bull
2000-04-01  0:00     ` Tucker Taft
2000-04-02  0:00       ` Robert Dewar
2000-04-02  0:00         ` Geoff Bull
2000-04-02  0:00       ` Geoff Bull
replies disabled

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