* procedure and generic package
@ 2003-11-20 20:34 lolo27
2003-11-20 20:46 ` Georg Bauhaus
2003-11-20 20:55 ` David C. Hoos
0 siblings, 2 replies; 8+ messages in thread
From: lolo27 @ 2003-11-20 20:34 UTC (permalink / raw)
hi
i need to pass a generic package to a procedure
what is wrong in the following code?
with p;
generic
with new_package is new p(<>);
package final_p is
procedure something(str:String;instant:new_package);
end final_automat;
thanks :)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: procedure and generic package
2003-11-20 20:34 procedure and generic package lolo27
@ 2003-11-20 20:46 ` Georg Bauhaus
2003-11-20 20:55 ` David C. Hoos
1 sibling, 0 replies; 8+ messages in thread
From: Georg Bauhaus @ 2003-11-20 20:46 UTC (permalink / raw)
lolo27 <limor_ru@walla.co.il> wrote:
: hi
: i need to pass a generic package to a procedure
: what is wrong in the following code?
with p;
generic
with new_package is new p(<>);
procedure something(str: String);
and then instantiate something where you need it.
-- Georg
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: procedure and generic package
2003-11-20 20:34 procedure and generic package lolo27
2003-11-20 20:46 ` Georg Bauhaus
@ 2003-11-20 20:55 ` David C. Hoos
2003-11-21 17:55 ` lolo27
1 sibling, 1 reply; 8+ messages in thread
From: David C. Hoos @ 2003-11-20 20:55 UTC (permalink / raw)
To: lolo27, comp.lang.ada@ada.eu.org
It's pretty obvious what's wrong. What did your compiler tell you?
"lolo27" <limor_ru@walla.co.il> wrote in message
news:92bfc3dd.0311201234.6d706aa6@posting.google.com...
> hi
> i need to pass a generic package to a procedure
> what is wrong in the following code?
>
>
> with p;
> generic
> with new_package is new p(<>);
>
> package final_p is
>
> procedure something(str:String;instant:new_package);
>
> end final_automat;
>
>
> thanks :)
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada-france.org
> http://www.ada-france.org/mailman/listinfo/comp.lang.ada
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: procedure and generic package
2003-11-20 20:55 ` David C. Hoos
@ 2003-11-21 17:55 ` lolo27
2003-11-21 18:39 ` Marius Amado Alves
0 siblings, 1 reply; 8+ messages in thread
From: lolo27 @ 2003-11-21 17:55 UTC (permalink / raw)
"David C. Hoos" <david.c.hoos.sr@ada95.com> wrote in message news:<mailman.35.1069361762.3110.comp.lang.ada@ada-france.org>...
> It's pretty obvious what's wrong. What did your compiler tell you?
>
> "lolo27" <limor_ru@walla.co.il> wrote in message
> news:92bfc3dd.0311201234.6d706aa6@posting.google.com...
> > hi
> > i need to pass a generic package to a procedure
> > what is wrong in the following code?
> >
> >
> > with p;
> > generic
> > with new_package is new p(<>);
> >
> > package final_p is
> >
> > procedure something(str:String;instant:new_package);
> >
> > end final_automat;
> >
> >
> > thanks :)
> > _______________________________________________
> > comp.lang.ada mailing list
> > comp.lang.ada@ada-france.org
> > http://www.ada-france.org/mailman/listinfo/comp.lang.ada
> >
please help me get it all right
my question is i need to write an ado that implement the generic
package.
in the ado i have a generic function that accept instant of the
generic
package.
i dont understand where to create the instant generic package in the
ads file or the adb file? and how do i pass it to the generic
function?
do i have to write generic section in the ado to create the generic
package instant?
this is what i wrote( i get subtype is reqiured in thus context)
ads:
----------------------------------------------------------
with generic_package;
generic
with package new_generic is new generic_package(<>);
package use_generic is
generic
procedure generic_procedure(str:String;a:in new_generic);
end use_generic ;
----------------------------------------------------------
adb:
package body use_generic is
procedure generic_procedure(str:String;a:in new_generic) is
begin
something........;
end generic_procedure;
end use_generic ;
thanx
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: procedure and generic package
2003-11-21 17:55 ` lolo27
@ 2003-11-21 18:39 ` Marius Amado Alves
2003-11-21 18:48 ` Preben Randhol
0 siblings, 1 reply; 8+ messages in thread
From: Marius Amado Alves @ 2003-11-21 18:39 UTC (permalink / raw)
To: comp.lang.ada
On Fri, 2003-11-21 at 17:55, lolo27 wrote:
> please help me get it all right
> my question is i need to write an ado that implement the generic
> package.
What on Earth is an "ado"?
> in the ado i have a generic function that accept instant of the
> generic
> package.
Surely you don't want to pass an "instant", because it will be gone just
after you passed it ;-)
Now serioulsy, what I think is the fundamental piece of Ada knowledge
that you're lacking is: packages are not objects. So, you cannot pass
packages to subprograms via parameters. You can of course pass objects
associated with *any* package including your *instance* e.g.
Op (X : Package_Instance.Object)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: procedure and generic package
2003-11-21 18:39 ` Marius Amado Alves
@ 2003-11-21 18:48 ` Preben Randhol
2003-11-21 19:34 ` Marius Amado Alves
0 siblings, 1 reply; 8+ messages in thread
From: Preben Randhol @ 2003-11-21 18:48 UTC (permalink / raw)
On 2003-11-21, Marius Amado Alves <amado.alves@netcabo.pt> wrote:
> On Fri, 2003-11-21 at 17:55, lolo27 wrote:
>> please help me get it all right
>> my question is i need to write an ado that implement the generic
>> package.
>
> What on Earth is an "ado"?
Perhaps: Abstract Design Object?
Or it can be something boring as:
http://www.w3schools.com/ado/ado_intro.asp
What is ADO?
* ADO is a Microsoft technology
* ADO stands for ActiveX Data Objects
* ADO is a Microsoft Active-X component
* ADO is automatically installed with Microsoft IIS
* ADO is a programming interface to access data in a database
--
"Saving keystrokes is the job of the text editor, not the programming
language."
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: procedure and generic package
2003-11-21 18:48 ` Preben Randhol
@ 2003-11-21 19:34 ` Marius Amado Alves
2003-11-21 19:56 ` Preben Randhol
0 siblings, 1 reply; 8+ messages in thread
From: Marius Amado Alves @ 2003-11-21 19:34 UTC (permalink / raw)
To: comp.lang.ada
On Fri, 2003-11-21 at 18:48, Preben Randhol wrote:
> ...Abstract Design Object?
> ...ActiveX Data Objects...
I know, but any of these is an "ADO", not an "ado" ;-)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: procedure and generic package
2003-11-21 19:34 ` Marius Amado Alves
@ 2003-11-21 19:56 ` Preben Randhol
0 siblings, 0 replies; 8+ messages in thread
From: Preben Randhol @ 2003-11-21 19:56 UTC (permalink / raw)
On 2003-11-21, Marius Amado Alves <amado.alves@netcabo.pt> wrote:
> On Fri, 2003-11-21 at 18:48, Preben Randhol wrote:
>> ...Abstract Design Object?
>> ...ActiveX Data Objects...
>
> I know, but any of these is an "ADO", not an "ado" ;-)
Ah.
Webster:
One entry found for ado.
Main Entry: ado
Pronunciation: &-'d�
Function: noun
Etymology: Middle English, from at do, from at + don, do to do
Date: 14th century
1 : fussy bustling excitement : TO-DO
2 : time-wasting bother over trivial details <wrote the paper without further ado>
3 : TROUBLE, DIFFICULTY
Much ado about nothing.
--
"Saving keystrokes is the job of the text editor, not the programming
language."
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2003-11-21 19:56 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-20 20:34 procedure and generic package lolo27
2003-11-20 20:46 ` Georg Bauhaus
2003-11-20 20:55 ` David C. Hoos
2003-11-21 17:55 ` lolo27
2003-11-21 18:39 ` Marius Amado Alves
2003-11-21 18:48 ` Preben Randhol
2003-11-21 19:34 ` Marius Amado Alves
2003-11-21 19:56 ` Preben Randhol
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox