Path: news.daimi.aau.dk!not-for-mail From: Peter Andersen Newsgroups: comp.lang.beta Subject: Re: Problems using "This()" Date: Fri, 6 Mar 1998 11:53:13 +0100 (MET) Organization: DAIMI, Computer Science Dept. at Aarhus University Lines: 48 Approved: mailtonews@daimi.aau.dk Distribution: world Message-ID: <199803061053.LAA01098@noatun.mjolner.dk> Reply-To: Peter Andersen NNTP-Posting-Host: daimi.daimi.aau.dk Xref: news.daimi.aau.dk comp.lang.beta:11446 Mikkel Orheim writes: > > > I wonder if anyone would know the answer to the following > problem: > When using "This()[]" to get the "self"-reference to a object, > I get error when combining it with concurrency. Ex: > > Agent: system > (# > ... > do > inner; > ... > #) > > A1: @| Agent > (# > Atest: ^| Agent; > do > This(Agent)[]->Atest[]; > #) > Yield an error because of the usage of "Atest: ^| Agent;" > When I use "Atest: ^Agent;" no error is given here (but is > propagated). This is *not* what I want! > Do anyone know how to cope with this? > This is because the current system cannot determine whether the outcome of the THIS operator should be an item or a component. So it is always an item, currently. To overcome this, you can INCLUDE '~beta/sysutils/v1.6/objinterface' and use the objectToComponent pattern, e.g. THIS(Agent)[] -> ObjectToComponent -> ATest[] Sincerely, Peter Andersen, Mjolner Informatics