comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <dont.bother.mcondic.auntie.spam@[acm.org>
Subject: Re: Function pointer in Ada?
Date: Tue, 14 May 2002 14:25:39 -0400
Date: 2002-05-14T18:25:41+00:00	[thread overview]
Message-ID: <abrkr5$b1h$1@nh.pace.co.uk> (raw)
In-Reply-To: 3ce15027.0@news.unibw-muenchen.de

That seems a sick and twisted thing to want to do! :-) Anyway, off the top
of my head, I'd guess that you can't do that. Ada tends to not let you have
much control over its standard stuff because compilers may want to treat it
very differently. (There may not be an actual function to point to, correct?
The compiler may see 'Standard."+"' and just generate an add instruction.)

However, you could define your own addition function that encapsulates the
standard "+" operator and try getting a pointer to that. It might let you do
what you want to do, but I suspect that whatever you are attempting to do,
there is a better way than with pointers to functions. Don't try to make Ada
look like C or C++ - learn to do it The Ada Way(tm). Perhaps if you describe
the problem you are trying to solve, you might get a better answer here.

MDC
--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com


"Kai Schuelke" <kai.schuelke@gmx.net> wrote in message
news:3ce15027.0@news.unibw-muenchen.de...
> Hello,
>
> I managed to get a function pointer (left, right : FLOAT) return FLOAT but
I
> couldn't manage to get a pointer to the according Standard."+". I tried
> various ways but had to use a workaround. Is it possible to do something
> like:
>
> plus_pointer : pointer_type := access Standard."+";
>






  parent reply	other threads:[~2002-05-14 18:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-14 12:51 Function pointer in Ada? Henrik Quintel
2002-05-14 13:08 ` Markus Knauss
2002-05-14 13:12 ` Marin David Condic
2002-05-14 14:36 ` Alfred Hilscher
2002-05-14 17:58 ` Kai Schuelke
2002-05-14 18:01   ` Preben Randhol
2002-05-14 18:24   ` David C. Hoos
2002-05-14 20:00     ` Kai Schuelke
2002-05-14 18:25   ` Marin David Condic [this message]
2002-05-15 22:30     ` Kai Schuelke
2002-05-16 11:37       ` Marc A. Criley
2002-05-16 19:06         ` Kai Schuelke
2002-05-16 19:18           ` Preben Randhol
2002-05-16 12:53       ` Georg Bauhaus
replies disabled

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