Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!NORUNIT.BITNET!HANCHE From: HANCHE@NORUNIT.BITNET Newsgroups: comp.lang.scheme Subject: Self reference in objects Message-ID: <8810192147.AA29943@BLOOM-BEACON.MIT.EDU> Date: 19 Oct 88 21:48:21 GMT Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 24 Date: 19 October 1988, 16:51:25 ECT From: Harald Hanche-Olsen +47-7-593525 HANCHE at NORUNIT To: scheme@mc.lcs.mit.edu (I suppose this should be sent directly to Jonathan Dubman who asked the question, but my mailer would not accept his monstrous address...) To: apple!bionet!agate!e260-3b.berkeley.edu!128a-3aj@BLOOM-BEACON.MIT.EDU Jonathan had problems with allowing his objects to refer to themselves. His objects are defined by lambda expressions, so I can't think of any reason why the following would not work: (define (make-player ...) (letrec ((self (lambda (...) ))) self)) or something like it. In you can use self to denote *this* player, like in (present-room 'move self 'north) - Harald Hanche-Olsen