comp.lang.ada
 help / color / mirror / Atom feed
From: "Jean-Pierre Rosen" <rosen@adalog.fr>
Subject: Re: SIGada Conference
Date: Mon, 5 Jan 2004 10:19:30 +0100
Date: 2004-01-05T10:19:30+01:00	[thread overview]
Message-ID: <muabtb.4vr.ln@skymaster> (raw)
In-Reply-To: 1071687303.254780@master.nyc.kbcfp.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1469 bytes --]


"Hyman Rosen" <hyrosen@mail.com> a �crit dans le message de news:1071687303.254780@master.nyc.kbcfp.com...
> Jean-Pierre Rosen wrote:
> > "Hyman Rosen" <hyrosen@mail.com> a �crit
> >>I expect this is just the usual "simulate MI with access discriminants"
> >>bit that always comes up here. I think it can do everything except support
> >>cross-casting.
> >
> > It can. See my paper at http://www.adalog.fr/publicat/ada-interfaces.pdf
>
> Does this mean that you think it can support cross-casting,
> or do you agree that it cannot? That is, in Java, I may have
> two interfaces:
>      interface IF_1 { }    interface IF_2 { }
> and given an object of type IF_1, I may try to see if it is
> also of type IF_2:
>      boolean is_both(IF_1 o) { return o instanceof IF_2; }
> and if it is, I can cross-cast:
>      IF_2 as_IF_2(IF_1 o) { return is_both(o) ? (IF_2)o : null; }
>
> Note that I can do this without any knowledge at all of the
> existence of one or more parent types which implement both
> interfaces. I don't think this can be done with the inner class/
> access discriminant approach.
>
What I meant is that if class A implements interface IF, and you get an object as an IF, you can get a view of it as an A. I didn't
consider the case you mention - presumably because I never met a need for it!

-- 
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr





  reply	other threads:[~2004-01-05  9:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-16 18:39 SIGada Conference amado.alves
2003-12-16 21:40 ` Georg Bauhaus
2003-12-16 22:17   ` Hyman Rosen
2003-12-17 17:51     ` Jean-Pierre Rosen
2003-12-17 18:55       ` Hyman Rosen
2004-01-05  9:19         ` Jean-Pierre Rosen [this message]
2004-01-05 15:35           ` Hyman Rosen
2003-12-16 23:33 ` Martin Dowie
  -- strict thread matches above, loose matches on Subject: below --
2003-12-17 13:31 amado.alves
2003-12-17 13:11 amado.alves
     [not found] <468D78E4EE5C6A4093A4C00F29DF513D04B82B08@VS2.hdi.tvcabo>
2003-12-17  1:01 ` Stephen Leake
2003-12-17  3:19   ` Robert I. Eachus
2003-12-18  6:55     ` Robert C. Leif
2003-12-15 23:01 Chris Miller
2003-12-16  0:29 ` Stephen Leake
2003-12-16 11:19   ` Georg Bauhaus
2003-12-17  0:58     ` Stephen Leake
2003-12-16 13:10   ` Marin David Condic
replies disabled

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