develooper Front page | perl.perl6.language.objects | Postings from November 2001

Re: Stupid Newbie Question

Thread Previous | Thread Next
From:
merlyn
Date:
November 19, 2001 12:15
Subject:
Re: Stupid Newbie Question
Message ID:
m1n11i7db4.fsf@halfdome.holdit.com
>>>>> "John" == John Rudd <jrudd@cats.ucsc.edu> writes:

John> 1) Methods are always public

John> 2) Variables are always private (and in this case that means that other
John> instances may not view the instance variables of an object; I don't
John> recall whether the class can see the ivars of its instances but I'm
John> pretty sure it can't).

No, an instance owns its ivars, so nobody touches it.  However, the
class for an instance can define a new method which of course acts
"within" the instance.

And there's always the system primitives used by the debugger (and
for other reflection), with names like instVarAt: and instVarAt:put:.
Anybody can send them!

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About