comp.lang.ada
 help / color / mirror / Atom feed
From: "Norman H. Cohen" <ncohen@watson.ibm.com>
To: "Nigel J. Tracey" <njt@sv1pc161.cs.york.ac.uk>
Subject: Re: Access to primitive operations of tagged types
Date: 1997/03/31
Date: 1997-03-31T00:00:00+00:00	[thread overview]
Message-ID: <33403878.2EDA@watson.ibm.com> (raw)
In-Reply-To: hkbmg5.2h2.ln@localhost


Nigel J. Tracey wrote:

> I am having a go at writing a class hierarchy to interface to X-Windows/
> Motif. My idea was to have tagged types for each of the widgets in
> Motif with various functions. Among these functions would be null functions
> for the callbacks. The user could then derive there own type from the
> widget-tagged type and over-ride these callbacks with there own custom
> functions.
> 
> My problem is however that I cannot pass an access to the callback functions
> when installing the callback routine in X.
> The Ada RM states that a dereference of an access-to-subprogram value is
> never a dispatching call.
> 
> Does this mean I cannot do the above?

Just pass an access value designating a nondispatching "wrapper
subprogram" whose body consists of a single dispatching call.  (Of
course the proper OO style would be to pass an access value designating
the classwide type of your root widget class, but Xlib wasn't designed
that way.)

-- 
Norman H. Cohen
mailto:ncohen@watson.ibm.com
http://www.research.ibm.com/people/n/ncohen




      parent reply	other threads:[~1997-03-31  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-03-18  0:00 Access to primitive operations of tagged types Nigel J. Tracey
1997-03-18  0:00 ` Jon S Anthony
1997-03-31  0:00 ` Norman H. Cohen [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