Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornellcs!newsstand.cit.cornell.edu!news.kei.com!newsfeed.internetmci.com!howland.reston.ans.net!torn!nott!cunews!dbuck
From: dbuck@superior.carleton.ca (Dave Buck)
Subject: Re: yourself ?
X-Nntp-Posting-Host: superior.carleton.ca
Message-ID: <DJq5wM.Goq@cunews.carleton.ca>
Sender: news@cunews.carleton.ca (News Administrator)
Organization: Carleton University, Ottawa, Canada
References: <494it7$3vl@fs2.abdn.ac.uk> <DILIB8.MAI@cunews.carleton.ca> <DJppGz.4vx@cunews.carleton.ca>
Date: Sun, 17 Dec 1995 09:48:22 GMT
Lines: 32

In article <DJppGz.4vx@cunews.carleton.ca>,
Evan Hughes <ehughes@chat.carleton.ca> wrote:
>Does "youself" have any other uses apart from terminating a string of
>cascaded messages? 

Cascaded messages account for virtually all of the cases where
"yourself" is used.  There are some other possible uses, but they are
contrived.  Suppose I maintained a dictionary of messages to send to
different objects to get back a string to display on the screen.  I
could write:

   stringFor: anObject
      ^anObject perform: (dictionary at: anObject class)

In the dictionary, I could have:
    Integer->#printString
    Client->#formattedPrintString
    String->#yourself
    ...

I would think twice (maybe three times) about using such a technique.
It does, however, demonstrate that it's possible to have another
meaningful use of "yourself".

David Buck
dbuck@ccs.carleton.ca

_________________________________
| David K. Buck                 |
| dbuck@ccs.carleton.ca         |
| The Object People             |
|_______________________________|
