Path: news.daimi.aau.dk!news.uni-c.dk!sunic!sunic.sunet.se!newsfeed.tip.net!news.seinf.abb.se!eua.ericsson.se!erinews.ericsson.se!cnn.exu.ericsson.se!convex!cs.utexas.edu!howland.reston.ans.net!Germany.EU.net!Dortmund.Germany.EU.net!Informatik.Uni-Dortmund.DE!veronica!warda From: warda@veronica.informatik.uni-dortmund.de (Armin M. Warda) Newsgroups: comp.lang.beta Subject: Re: How to obtain a ref. to current _component_ obj.? Date: 9 May 1995 16:14:03 GMT Organization: CS Department, Dortmund University, Germany Lines: 94 Sender: warda@veronica (Armin M. Warda) Distribution: world Message-ID: <3oo4cb$jpd@fbi-news.informatik.uni-dortmund.de> References: <3nj0if$6hh@fbi-news.informatik.uni-dortmund.de> <3nkp02$17i@engnews2.Eng.Sun.COM> NNTP-Posting-Host: veronica.informatik.uni-dortmund.de Keywords: component,current,this To: olm@Eng.Sun.COM (O. L. Madsen), sbrandt@daimi.aau.dk (S. Brandt), warda In article <3nkp02$17i@engnews2.Eng.Sun.COM>, Ole Lehrmann Madsen writes: |> (Armin M. Warda) writes: |> |> >Why is the following illegal for the BETA-Compiler [Mjolner BETA System |> >version 5.0(2) for SUN-4]? |> |> > (# Process: |> > (# me: ^|Process; |> > do this(Process)[]->me[]; |> |> The problem here is that the compiler dont know whether this(process) |> is an item or a component. It currently assumes that is an item |> and an item cannot be assigned to a component. |> |> This would be possible by performing a run-time check similar |> to the ones performed when assigning a less qualified reference to |> a more qualified reference (like aVehicle[] -> aBus[]) |> |> I hope this is supported in the next release of the compiler. |> |> > INNER |> > #); |> > A: @|Process (# do 'A' -> putline #); |> > do A; |> > #) And in article <3o2mul$2vn@belfort.daimi.aau.dk>, sbrandt@daimi.aau.dk (S. Brandt) writes: |> Because assignment between component and object references has |> not been implemented by the current compiler. It is easily handled, |> but has not been done. What exactly would or will be possible? a) That the compiler or the runtime system can determine if this(process) refers to an item or component? Thus, will the code fragment above be legal? b) That a component reference can be assigned to an object reference and vice versa? Thus, will it be possible to do the following: (# anItemRef : ^ object; (* a dynamic ref. to an item *) aCompRef : ^ | object; (* a dynamic ref. to a component *) anItem : @ (# do ...; #); (* a static ref. to a singular item *) aComp : @ | (# do ...; #); (* a static ref. to a singular comp. *) do aComp[] -> aCompRef[]; (* legal *) anItem[] -> anItemRef[]; (* legal *) aComp[] -> anItemRef[]; (* illegal *) anItemRef[] -> aCompRef[]; (* illegal *) aCompRef; (* attach component *) #) It seems to me that items and components are orthogonal concepts in BETA: 'object' is the abstract superpattern for every item and '|object' is the abstract superpattern for every component. Did I get this right? I think items and components should not be ortogonal concepts. Perhaps a component should simply be a more qualified item. Then it should be possible to do what is marked by (* illegal *) in the above example (b), because in aComp[] -> anItemRef[] a more qualified object reference would be assigned to a less qualified object reference (no runtime qualification check needed) and in anItemRef[] -> aCompRef[] the dynamic reference anItemRef[] denotes an object with the same qualification as aCompRef[] (would have to be checked by a runtime qualification check, as usual). I think the whole trouble with the distinction between item and component arises from the decision to declare each object reference explicitly as an item reference (^, @) or component reference (^|, @|). Why cannot an object be an item until it makes it's first (implicit or explicit) SUSPEND, in which case it becomes a component? Of cause the distinction between items and components would be absolutely superfluous then and only be needed -- if at all -- to talk about objects' behaviour. What do you think? A. --------------------------------------------------------------------- Armin M. Warda Universitaet Dortmund, Informatik IV, GB V, R.503, Tel: 0231-755-4824 44221 Dortmund, Privat: , Tel: 0231-75-37-30 WWW: "http://ls4-www.informatik.uni-dortmund.de/QM/MA/warda/pi.html" PGP fingerprint = 66 C0 3E 8E D9 FE 61 77 DB 37 0D 40 36 53 71 6A