comp.lang.ada
 help / color / mirror / Atom feed
From: "Ehud Lamm" <mslamm@huji.ac.il>
Subject: Re: array of operations
Date: Tue, 10 Sep 2002 19:09:55 +0200
Date: 2002-09-10T19:09:55+02:00	[thread overview]
Message-ID: <all5t1$f16$1@news.iucc.ac.il> (raw)
In-Reply-To: 3D7E0EB1.2070708@attbi.com


"Mark Biggar" <mark.a.biggar@attbi.com> wrote in message
news:3D7E0EB1.2070708@attbi.com...
> marco wrote:
> > Do you know if there is some way of bulding up arrays of functions
and/or
> > procedures?...
>
> Sure, Ada allows for access types to functions and procedures so you
> construct an array of those.

Notice that all the procedures must have the same parameter profile. There
are cases where this isn't what you want.
There are also nesting issues (you can't have a top level array linking to
nested subroutines) [Note to language lawyers: The last sentence was not
meant to be a formal definition...]

So in many cases you may decide (after thinking about "access procedure" and
"access function") to use a dispatching routine that is invoked with an
"opcode" (operation code) and calls the appropriate routine.

Ehud





  reply	other threads:[~2002-09-10 17:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-10 13:45 array of operations marco
2002-09-10 15:28 ` Mark Biggar
2002-09-10 17:09   ` Ehud Lamm [this message]
2002-09-11  7:43     ` Ole-Hjalmar Kristensen
2002-09-11 10:10       ` Ehud Lamm
2002-09-11 23:43         ` Randy Brukardt
2002-09-12  9:01           ` Ehud Lamm
2002-09-12 14:32             ` Mark Biggar
2002-09-12 16:15               ` John McCabe
2002-09-12 16:37                 ` David C. Hoos
2002-09-12 17:45                   ` John McCabe
2002-09-11  2:17 ` Ted Dennison
replies disabled

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