Hello and thanks,
after taking a nap and resting a bit I could finally see what was wrong
which is really easy (you explaining the problem really made it easier for
me to know exactly where to look and what to look for). I was writing:
meth init(X Y)
.....
.....
{self.x = X}
{self.y = Y}
......
.....
end
instead of
meth init(X Y)
......
......
self.x = X
self.y = Y
......
.......
end
I don't even know how I wrote the {} and how I didn't notice them until now
(maybe because there where too many other lines in my init method that those
2 lines didn't stand out that much).
Anyway, thanks again for the help.
2010/8/16 Wolfgang Meyer <[email protected]>
> 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
>
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users