comp.lang.ada
 help / color / mirror / Atom feed
* Generic primitives
@ 1999-07-18  0:00 Aidan Skinner
  1999-08-04  0:00 ` Matthew Heaney
  0 siblings, 1 reply; 2+ messages in thread
From: Aidan Skinner @ 1999-07-18  0:00 UTC (permalink / raw)


Right, I'm wondering if it's possible to make a generic program a
primitive operation of a class. Basically I want this to work:

--begin code fragment--

  declare
  type Foo is abstract tagged private;

  generic
     with procedure Bar (Flibble : in Foo);

  procedure Tribble (Flibble : in Foo) is abstract;

  type Fubar is new Foo with null record;

  procedure Tribble (Flibble : in Fubar) is

  begin
     Bar (Flibble);
  end Tribble;

  type Wibble is new Fubar;

  Wibble1 : Wibble;

  Tribble (Wibble1);

  end;

--end code fragment--

Currently GNAT thinks that there should be a semicolon after the
partenthesis at the declaration of trrible and that tribble isn't a
primitive operation.

How do I get around this?

- Aidan
--
http://www.skinner.demon.co.uk/aidan/
How much can could ICANN can if ICANN could can-can?




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Generic primitives
  1999-07-18  0:00 Generic primitives Aidan Skinner
@ 1999-08-04  0:00 ` Matthew Heaney
  0 siblings, 0 replies; 2+ messages in thread
From: Matthew Heaney @ 1999-08-04  0:00 UTC (permalink / raw)


In article <slrn7p4agv.2so.aidan@skinner.demon.co.uk>,
aidan@skinner.demon.co.uk (Aidan Skinner) wrote:


>Right, I'm wondering if it's possible to make a generic program a
>primitive operation of a class. 

I've been away from CLA for awhile, and so I'm not sure if anyone answered
your question.  The answer is, No, generic operations aren't primitive for
the type.

Mats Weber discussed this feature (flaw?) in his PhD thesis.  I don't have
the URL handy.

Can you make the operation class-wide?  What about making a (non-generic)
primitive operation that takes Bar as an argument (pointer to subprogram)?


>  declare
>  type Foo is abstract tagged private;
>
>  generic
>     with procedure Bar (Flibble : in Foo);
>
>  procedure Tribble (Flibble : in Foo) is abstract;
>
>  type Fubar is new Foo with null record;
>
>  procedure Tribble (Flibble : in Fubar) is
>
>  begin
>     Bar (Flibble);
>  end Tribble;
>
>  type Wibble is new Fubar;
>
>  Wibble1 : Wibble;
>
>  Tribble (Wibble1);
>
>  end;




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-08-04  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-18  0:00 Generic primitives Aidan Skinner
1999-08-04  0:00 ` Matthew Heaney

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