A provocative naming idea for "setter" methods

Rastislav Kassak kasou.sk at gmail.com
Thu Sep 22 02:02:05 PDT 2005


What about ">A"? :))


Seriously, even if "A=" is more complicated (lexer rewrite), I can't
help myself, but I don't feel natural with "=A".
More than 10 years of programming in languages with traditional
assignments makes me biased. And I'm sure, I'm not the only one.

In Ruby, getter and setter methods are also defined as:

def handle
end

def handle= (param)
end

So In Slate adding slot automaticaly adds 2 methods: getter "A handle"
and setter " A handle=: B".
Making it "A=" in source code is only matter of slight change in
parsing, I think.


If we are going to change it, I vote for "A=".



On 9/22/05, Brian Rice <water at tunes.org> wrote:
> I should also note that A:= is also valid, except that it has the
> same problem as "A=" of currently being recognized as unary when we'd
> want this case to be handled as a binary selector.
>
> (Hopefully we can conclude this thread shortly so I can address the
> more interesting and pressing issue of improving inheritance.)
>
> On Sep 20, 2005, at 5:11 PM, Brian T. Rice wrote:
>
> > I guess I should point out that I do prefer the "A=" or "=A"
> > suggestions over the ones in my original post, which I will agree
> > are very confusing and should be considered scrubbed in favor of one
> > of those. :)
>
> --
> -Brian
>
>




More information about the Slate mailing list