On Tue, 27 Feb 2001, Kevin Smith wrote:
> >> Using this scheme I could write the above as:
> >>   class Msg
> >>     def initialize(@name, @type, @txt)
> >>     end
> >I agree with that change.
> >This also makes an attribute writer something like: 
> >def some_attr=(@some_attr); end
> 
> Hmmmmmm. I can see the value for the initialize 
> method. But we alerady have an attribute writer 
> shortcut, so the latter doesn't help me.

I know. I was just observing that it happened that with that feature there
is only a difference of two characters between the expanded version of a
writer and the one of a reader.

> I'm concerned that ANY method can smack your 
> member variables when you might have just 
> accidentally put the @ in out of habit from 
> writing it so many times elsewhere.

You may also smack your program in so many other ways. Imagine, you can
put * and & in lots of parameter lists already.

> Could we say that initialize is the only method 
> to get this special treatment? 

Certainly not. Neither the parser nor the interpreter "know" that
#initialize even exists. Why should they?

> Or is there some way to have one line of code 
> that means "copy each of the passed parameters 
> into member variables with corresponding names"? 
> This would allow something like this:
>   def initialize(name, type, txt)
>      set_locals_to_params
	
To me, the only point of @ in parameter lists was to make methods and
procs a little more alike. It seems that not many people have realized
this.

matju