Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!spool.mu.edu!think.com!barmar From: barmar@think.com (Barry Margolin) Newsgroups: comp.object Subject: Re: The Emperor Strikes Back Message-ID: <1991Feb23.075248.10519@Think.COM> Date: 23 Feb 91 07:52:48 GMT References: <3351@sequent.cs.qmw.ac.uk> Sender: news@Think.COM Distribution: comp.object Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 34 In article alms@cambridge.apple.com (Andrew L. M. Shalit) writes: >In article <3351@sequent.cs.qmw.ac.uk> steve@cs.qmw.ac.uk (Steve Cook) writes: > The killer is 'lexically-scoped'. >I agree with Steve. In object-oriented programming, the meaning of an >identifier (message or variable) depends on the reciever (which is >part of the run-time program state). This is essentially a >disciplined form of dynamic binding. It's very different from lexical >binding, in which the meaning of an identifier can be derived purely >from the surrounding program text. I believe the lexical scoping referred to is the implementation of instances as procedures that remember their instance variables in lexical variables, e.g.: (define (make-frob iv1 iv2 iv3) (lambda (operation args) (cond ((eq operation 'set!-iv1) (set! iv1 (car args))) ((eq operation 'iv1) iv1) ... ((eq operation 'sum) (+ iv1 iv2 iv3))))) (set! my-frob (make-frob 1 3 5)) (my-frob 'iv1 nil) => 1 (my-frob 'set!-iv1 '(4)) (my-frob 'sum nil) => 10 -- Barry Margolin, Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar Brought to you by Super Global Mega Corp .com