What scope is implemented in Squeak? Where can I find proper tutorial or description of this for Squeak's implementation? Regards,Azka
Unfortunately this is not a question with a short answer.
Namespace for instance variables: they're visible within the instance object they live in. Class variables are tricky; they're visible to the class they belong to as well as its subclasses. Class instance variables are visible only from the class they're declared in.
Blocks in brackets which look like [Object inspect] may have closure semantics (this is true in the latest Squeak, Pharo, and Cuis, but hasn't been integrated in e.g. Scratch.)
Traditionally, Smalltalk-80 has had a single global namespace for classes, but I think Squeak and Pharo are running Environments now, which breaks up the single class namespace in a way familiar from languages wherein one must include xyz in order to get access to certain state and behavior.
Hopefully this helps, as confusing as it is.
On Jun 23, 2013, at 1:41 PM, Azka Niazi azka.akn@live.com wrote:
What scope is implemented in Squeak? Where can I find proper tutorial or description of this for Squeak's implementation?
Regards, Azka _______________________________________________ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Just a simple question. Although it seems pretty obvious but just for the sake of confirming, are the class variables also visible to the subclasses of subclasses and so on?
Subject: Re: [Newbies] Scope? From: casey.obrien.r@gmail.com Date: Sun, 23 Jun 2013 15:20:50 -0700 To: beginners@lists.squeakfoundation.org
Unfortunately this is not a question with a short answer. Namespace for instance variables: they're visible within the instance object they live in. Class variables are tricky; they're visible to the class they belong to as well as its subclasses. Class instance variables are visible only from the class they're declared in. Blocks in brackets which look like [Object inspect] may have closure semantics (this is true in the latest Squeak, Pharo, and Cuis, but hasn't been integrated in e.g. Scratch.) Traditionally, Smalltalk-80 has had a single global namespace for classes, but I think Squeak and Pharo are running Environments now, which breaks up the single class namespace in a way familiar from languages wherein one must include xyz in order to get access to certain state and behavior.
Hopefully this helps, as confusing as it is.
On Jun 23, 2013, at 1:41 PM, Azka Niazi azka.akn@live.com wrote:
What scope is implemented in Squeak? Where can I find proper tutorial or description of this for Squeak's implementation? Regards,Azka _______________________________________________ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
_______________________________________________ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Yes, class variables will be visible to subclasses of subclasses and so on. Also, I didn't mention pool variables, but 99.9% of the time you won't want to use those.
On Fri, Jun 28, 2013 at 7:27 AM, Azka Niazi azka.akn@live.com wrote:
Just a simple question. Although it seems pretty obvious but just for the sake of confirming, are the class variables also visible to the subclasses of subclasses and so on?
Subject: Re: [Newbies] Scope? From: casey.obrien.r@gmail.com Date: Sun, 23 Jun 2013 15:20:50 -0700 To: beginners@lists.squeakfoundation.org
Unfortunately this is not a question with a short answer.
Namespace for instance variables: they're visible within the instance object they live in. Class variables are tricky; they're visible to the class they belong to as well as its subclasses. Class instance variables are visible only from the class they're declared in.
Blocks in brackets which look like [Object inspect] may have closure semantics (this is true in the latest Squeak, Pharo, and Cuis, but hasn't been integrated in e.g. Scratch.)
Traditionally, Smalltalk-80 has had a single global namespace for classes, but I think Squeak and Pharo are running Environments now, which breaks up the single class namespace in a way familiar from languages wherein one must include xyz in order to get access to certain state and behavior.
Hopefully this helps, as confusing as it is.
On Jun 23, 2013, at 1:41 PM, Azka Niazi azka.akn@live.com wrote:
What scope is implemented in Squeak? Where can I find proper tutorial or description of this for Squeak's implementation?
Regards, Azka
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
_______________________________________________ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
"Casey" == Casey Ransberger casey.obrien.r@gmail.com writes:
Casey> Yes, class variables will be visible to subclasses of subclasses Casey> and so on. Also, I didn't mention pool variables, but 99.9% of Casey> the time you won't want to use those.
+1
Casey Ransberger-2 wrote
I think Squeak and Pharo are running Environments now
No namespaces yet for Pharo...
----- Cheers, Sean -- View this message in context: http://forum.world.st/Scope-tp4694748p4697757.html Sent from the Squeak - Beginners mailing list archive at Nabble.com.
beginners@lists.squeakfoundation.org