Newsgroups: comp.lang.beta Path: news.daimi.aau.dk!news.uni-c.dk!nntp-oslo.UNINETT.no!nntp-trd.UNINETT.no!online.no!oslonett.no!sn.no!Norway.EU.net!EU.net!newsfeed.internetmci.com!uwm.edu!math.ohio-state.edu!newsfeed.acns.nwu.edu!ftpbox!mothost!schbbs!news From: shang@corp.mot.com (David L. Shang) Subject: Re: THIS and COMPONENTs Reply-To: shang@corp.mot.com Organization: MOTOROLA Date: Mon, 22 Jul 1996 18:39:26 GMT Message-ID: <1996Jul22.183926.19241@schbbs.mot.com> References: Sender: news@schbbs.mot.com (SCHBBS News Account) Nntp-Posting-Host: 129.188.128.126 Lines: 55 In article kasper@cosc.cosc.canterbury.ac.nz (Kasper Osterbye) writes: > Hi, > > Is there a way to obtain a referece to the currently executing > co-routine? > > I need it for a simulation framework where I would like a co-routine > to put itself into a queue. > Or is the lack of such a feature the reason why it is S[]->fork rather > than S.fork? > An interesting question. I would like to know the answer too. May I have: AnimatedObject: (# ... Move: (# path: ^Path; enter (path) do this(Move)->actionSchedule.put; #) #) ? In Transframe, you can do: class AnimatedObject { ... class Move is function { enter (path: Path) { actionSchedule.put(self) }; }; }; "self" denotes the innest enclosed. If the self of "AnimatedObject" must be used, use scope resolution operator: class AnimatedObject { ... class Move is function { enter (path: Path) { actionSchedule.put(AnimatedObject::self) }; }; }; David Shang