From: Christoph Rippel Date: 2001-03-06T07:35:15+09:00 Subject: [ruby-talk:12066] Re: RCR: shortcut for instance variable initialization > From: Christoph Rippel [mailto:crippel@primenet.com I am afraid I was not very clear, > I was thinking that would have been forced > into writing (basically reviving standard > variable declaration I still prefer;-) > > def bla(right) > attr_accessor :left > left = right > end I mend to so say that since variables are nothing but constant function calls (who's (calling) value can be changed via assignment - i.e. a call to an attr_writer) why have the two distinct concept of variables and functions around at all? As for initialized function calls my idea was to introduce a magic syntax on the function name lets say def fun@(a, b, c) ... end which would mean that the lines def fun(a,b,c) @a,@b,@c = a,b ,c ... end are created or restrict it to ``initialize'' via ``initialized''. This is not as flexible David's proposal (which is pretty good IMO), but I am not very opinionated on the matter anyway ... Christoph