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

Re: Stupid Newbie Question

Thread Previous | Thread Next
November 19, 2001 12:15
Re: Stupid Newbie Question
Message ID:
>>>>> "John" == John Rudd <> 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
<> <URL:>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See for onsite and open-enrollment Perl training!

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About