A provocative naming idea for "setter" methods

Brian Templeton bpt at tunes.org
Fri Oct 7 23:21:57 PDT 2005


Bill Sun <billksun at yahoo.com> writes:

> That sort of sparked another idea here...
>
> What about:
>
> object1 set:
> object1 get
>
> or
>
> object1 slot1 set:
> object1 slot1 get
>

What about using a macro?

m@(Syntax UnaryMessage traits) set: v
[
  Syntax KeywordMessage
    sending: (intern: m selector name ; ':')
    to: { m arguments first. v. }
].

addSlot: #foo.
foo `set: 42.

-- 
              bpt <bpt at tunes.org> http://bpt.tunes.org/               
  (let((!'(let((!'?))(subst !(intern"?")!)))) (subst !(intern"?")!))  
 "The great are only great because we are on our knees. Let us rise!" 
                                                -- Max Stirner        




More information about the Slate mailing list