comp.lang.ada
 help / color / mirror / Atom feed
From: castroto@remus.rutgers.edu (Fabrizio Castrotorres)
Subject: Re: Passing a function "pointer"
Date: 1998/05/26
Date: 1998-05-26T00:00:00+00:00	[thread overview]
Message-ID: <6kf2fc$aqg$1@remus.rutgers.edu> (raw)
In-Reply-To: matthew_heaney-ya023680002405981106270001@news.ni.net


Could you not use a function that takes as an argument a generic function ?
If this is all you need to do a generic function argument should do the trick.

matthew_heaney@acm.org (Matthew Heaney) writes:

>In article <3567CBEB.3098@mpce.mq.edu.au>, Brendan Reville
><breville@mpce.mq.edu.au> wrote:

>>I need to pass a "pointer" (access type?) to a procedure, to another
>>procedure.  The second procedure will then call the first using this
>>pointer.  How exactly can I do this?  Do I need to create an access type
>>to a procedure??  (I'm mainly not sure about the syntax...)

>Ada is described in terms in BNF in the RM; you may have learned how to
>learn BNF in your compiler class or something.

>Follow the syntax as it appears in the RM.  The description of access types
>is in section 3.10.

>Here are a couple of examples:

>type Procedure_Access is access procedure (I : in Integer);

>type Function_Access is access function (I : Integer) return Float;

>>Actually, I also need to do this, not for a normal procedure, but for a
>>task's entry point.  Can I pass a "pointer" to a task's entry point? 
>>Again, exactly how?

>I'm not sure you can do that.  You may have to call a wrapper procedure,
>that in turn calls the task entry.

>>Thanks heaps.  I'm doing Ada for an honours course, and just wasn't sure
>>how to do these things.

>You need to read the RM.  Copies are available on-line if you don't have a
>hard-copy.

><http://www.adahome.com/>




      reply	other threads:[~1998-05-26  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-05-24  0:00 Passing a function "pointer" Brendan Reville
1998-05-24  0:00 ` Matthew Heaney
1998-05-26  0:00   ` Fabrizio Castrotorres [this message]
replies disabled

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