Hi Khadija,
don't worry about asking too many question - that's what the mailing
list is for, after all :-)
> Anyway, the problem here is that if I change the test class in remote2.oz
> and make the init class similar to the one you've written with features and
> all, when trying to create a remote object using "RemoteObject =
> {CreateRemoteStationaryObject Test init(7 8)}" (for example), it just
> doesn't work and I get the following:
>
> $ ./remote2
>
> %********************** error in application ********************
> %**
> %** Application of non-procedure and non-object
> %**
> %** In statement: {7}
> %**--------------------------------------------------------------
>
> (If I'm doing anything wrong please enlighten me)
> I've tried to search for a solution and found this link:
> http://www.mozart-oz.org/lists/oz-users/4037.html
> Can I make use of the suggestion made? If yes, how?
I think that the problem is different from the one in that message.
There seems to be an error in the "init" method.
Somehow a variable which is used like a procedure, ends up with the
value 7. In other words, the emulator tries to call "7" which does not
work because "7" is not a procedure. Maybe there is a conflict with
variable names. Can you show us the code of the init method?
To get a better error message (with line numbers), you can use an
improved version of CreateRemoteStationaryObject:
---
local
RM = {New Remote.manager init}
in
fun {CreateRemoteStationaryObject Class Init}
functor RemoteCode
export result:Result
define
%% create a stationary instance on the remote site
Result = try {NewStat Class Init} %% here is the difference
catch E then
{Value.failed E}
end
end
AppliedFunctor = {RM apply(RemoteCode $)}
in
AppliedFunctor.result
end
end
----
This version catches exceptions in the object construction phase and
wraps them in "failed values". The exception is raised again later
when the failed value is accessed on the local site. The result is a
proper error message on the local site.
Cheers,
Wolfgang
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users