Hello --

On Thu, 5 Sep 2002, William Djaja Tjokroaminata wrote:

> Hi,
>
> I agree that "@" and "self." are very minor syntactic choice.  Even when
> the object itself is passed as the first argument into an object method I
> have no big problem with that.  The biggest problem for me is that in
> Python an object is pretty much like a hash; this is equivalent as having
> all data members as public in C++.  (Sure, there is a way around this in
> Python, but it has to be manually made by the programmer, not built-in in
> the language itself.)  In Ruby, on the other hand, all data members are
> private by default (which is the recommended practice in C++), unless we
> explicitly make it otherwise (through the accessor methods).  Therefore we
> have a standard information hiding in Ruby and not at all in Python.  This
> is one of the most important reasons why I switched from Python to Ruby.
>
> Regards,
>
> Bill
> ========================================================================
> Paul Prescod <paulp / prescod.net> wrote:
> > It's a minor syntactic choice that hardly has any large-scale effects
> > either positive or negative. IIRC, Ruby uses "@" so you do a search and
> > replace for "@" to "self." and you add "self." to your method declarations
> > and you are done. I would not see that as the basis to switch from one
> > language to another but your mileage may vary. Python's way may feel
> > hackish to Ruby people, but Ruby's addition of "extra" syntax feels
> > hackish to Python people.

I may be misunderstanding this discussion (I don't know Python), but
I'm not sure in what sense @ and self. are interchangeable in Ruby.
Or, I should say, I'm aware that there's a very limited sense in which
they sometimes are in effect interchangeable (simple accessor methods
vs. assignment to instance variables), but I don't think that extends
to the general case.


David

-- 
David Alan Black                      | Register for RubyConf 2002!
home: dblack / candle.superlink.net     | November 1-3
work: blackdav / shu.edu                | Seattle, WA, USA
Web:  http://pirate.shu.edu/~blackdav | http://www.rubyconf.com