From: Ole-Hjalmar Kristensen <oleh@vlinux.voxelvision.no>
Subject: Re: array of operations
Date: Wed, 11 Sep 2002 07:43:07 GMT
Date: 2002-09-11T07:43:07+00:00 [thread overview]
Message-ID: <7vfzwh9dkl.fsf@vlinux.voxelvision.no> (raw)
In-Reply-To: all5t1$f16$1@news.iucc.ac.il
"Ehud Lamm" <mslamm@huji.ac.il> writes:
> "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
Or a pointer to an object and let the dispatching mechanism implement
the function pointer behind the scenes.
next prev parent reply other threads:[~2002-09-11 7:43 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
2002-09-11 7:43 ` Ole-Hjalmar Kristensen [this message]
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