Hello,
I know I've been asking a lot of questions but I just want to have a better
understanding of distributed programming using Mozart.
For the past 2 days I've been trying to modify the code I've obtained so far
(with the creation of stationary objects the test class and all. Basically
the remote2.oz) and I'm only asking after trying to solve the problem myself
because running toward others to solve my problems without at least trying
to do so myself isn't my style.
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?
Like suggested in the link I've read the "Distributed Programming" tutorial
many times so far since I've started working with Mozart/oz but I still
don't quite see how to get things done (Like I said, I'm quite the beginner
when it comes to Mozart/Oz).
Thanks a lot and sorry if I'm being a bother.
2010/8/13 Wolfgang Meyer <[email protected]>
> Hi again,
>
> the RemoteObject is wrapped in a procedure. Because of this, the
> dot-notation to access features does not work from outside of the
> object itself.
> With respect to attributes, nothing should have changed because you
> can't access those from outside the object anyway.
> I recommend to use accessor methods. If you don't want to write a
> special method for every feature, you may also write a generic
> accessor method:
>
> declare
>
> class Test
> feat
> a
> b
>
> meth init(A B)
> self.a = A
> self.b = B
> end
>
> meth get(Feature $)
> self.Feature
> end
> end
>
> T = {New Test init(13 17)}
> {Show {T get(a $)}}
> {Show {T get(b $)}}
>
>
> Cheers,
> Wolfgang
>
> On 8/13/10, Khadija EL MAHRSI <[email protected]> wrote:
> >
> > Hello,
> > I have another question, in the remote2.oz you sent me can't I add
> attributes and features to the test class in which I put different values
> through the init method and then after using "RemoteObject =
> {CreateRemoteStationaryObject Test init}" check out the values the
> arrtibutes and features contain? (I tried to do so but failed. Maybe I'm
> doing something wrong.)
> >
> > thanks
> >
>
> _________________________________________________________________________________
> 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