A provocative naming idea for "setter" methods

Brian T. Rice water at tunes.org
Wed Sep 21 14:54:30 PDT 2005


That conflicts with Slate and Smalltalk's entire evaluation model
and grammar. Messages return values, and you cannot send a message
to an object to change the container you used to get it. This is
symptomatic of Java thinking, not object-thinking.

To put it in perspective, you'd have to recurse, "get"ing the result
of a "get", because everything you access/name is a message-send.
It's not an l-value in formal grammatical terms.

Bill Sun <billksun at yahoo.com> said:

> That sort of sparked another idea here...
> 
> What about:
> 
> object1 set:
> object1 get
> 
> or
> 
> object1 slot1 set:
> object1 slot1 get
> 
> 
> --- Ken Causey <ken at kencausey.com> wrote:
> 
> > I just want to say that I personally prefer the
> > current getter/setter
> > scheme.  I do see your point regarding the noun/verb
> > confusion.  But I
> > have a word over symbol bias that causes me to
> > dislike the proposed
> > solutions.  My solution would be to convert the
> > nouns into verb phrases
> > by prepending 'set' or 'get' to the slot name and
> > camel-casing it.  In
> > other words having a read/write slot called 'handle'
> > would result in
> > message names 'getHandle' and 'setHandle:'.  My 2
> > cents.
> > 
> > Ken
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 



-- 






More information about the Slate mailing list