[omniORB] Re: Promoting from integer to double in a union?

Duncan Grisby dgrisby@uk.research.att.com
Mon, 20 Mar 2000 15:32:27 +0000


On Monday 20 March, Jason Tackaberry wrote:

> > I didn't really expect this to work, but it does with Fnorb and
> > omniORB. On the other hand, with orbit-python I get an exception:
> > 
> >   CORBA.SystemException: IDL:omg.org/CORBA/BAD_PARAM:1.0: 
> >       Expected float, got int
> 
> I was debating about whether or not I should promote ints to floats.  For
> consistency and readability, I decided to require a float value.  Also,
> the Python Language Mapping Specification doesn't explicitely permit
> integers here (I think).

This sort of discussion comparing Python ORBs would be better off in
do-sig@python.org.

An earlier version of the Python mapping did specify that compatible
types should be promoted. The current version has removed that
requirement. I think it is best to avoid promoting types in most
cases, and omniORBpy is reasonably strict. The only three promotions
it does are integers to floats, integers to doubles, and integers to
long integers, for the pragmatic reason that people often use integers
in those cases.

The mapping spec should perhaps be tightened up to either explicitly
permit or forbid such things.

Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --