Problem getting started with Orber

Luke Gorrie <>
Fri Apr 16 15:34:15 CEST 1999


Lars Thorsen <> writes:

> i think the problem is that the Orber application isn't running.

Thanks very much, you're quite right -- I cottoned on to this after
taking a better look at the examples.  I think I was trying to run
before I'd learned to walk. :)

I've been playing with Orber a bit today, and I have some new
questions for you.

Firstly, I've noticed that calls to objects which take floats as
parameters strictly require a float to be passed in the erlang code,
and won't coerce an integer.  Thus if you have an operation "foo(in
float value)", then calling foo(10) will fail to bind to a marshalling
function because the guard requires a float() -- foo(10.0) must be
used instead.  I loosened the guards on the marshalling code from
float() to number() which seems more intuitive to me, does this seem
like a good modification?  It doesn't introduce ambiguity because the
fact that it will become a float has already been ascertained from the
typecode, and from my limited testing it seems to work properly.

Also related to the point above, I notice that Orber seems to bypass
marshalling for calls made to objects belonging to the same Orber
application.  While this is a good thing, it bypasses the float()
check and thus accepts integers in the place of floats, so there is a
semantic difference between calling local and remote objects.  By
making the change above things are made consistent, though.

It's getting late here in Australia, so I'm having to turn in for the
evening without investigating another possible bug -- it seems that
doubles are not being marshalled correctly.  When I send a double to a
JavaIDL server, it is received with the wrong value, and then Orber
fails while trying to unmarshal the reply (which is the same value
sent back).  I couldn't guarantee that I didn't introduce this problem
while hacking at Orber, I'll take a better look at it tomorrow or on
Sunday, but I thought I'd best check incase it was a known problem or
it was obvious to someone -- I'm just starting out with Erlang and I
can't read the code too fluently (yet!).

On a side note, I was wondering how one can convert an integer to a
float (perhaps to satasfy an overly strict guard)?  I didn't see a BIF
for it.

That's all, thanks for your attention.

BTW, I had a chance to learn to use the debugger today, it's very
convenient.  Erlang seems to manage to astound me several times a day
- though maybe too much Java has lowered my expectations ;-).

Cheers,
Luke




More information about the erlang-questions mailing list