[Squeakland] When to define a local variable

Alan Kay alan.kay at squeakland.org
Sun May 20 05:40:53 PDT 2007


Hi Folks --

This list is mostly for teachers, parents and children, and is about 
the Etoys part of Squeak. Please use either the Squeak.org or the 
opencroquet.org (or one of the other Croquet lists) for these kinds of issues.

Thank you,

Alan

-------------

At 09:11 PM 5/19/2007, Laurence Rozier wrote:
>Hi,
>Sorry for the delayed response ... I'm not on a Windows machine at 
>the moment but have applied available fixes to OpenGL problems which 
>you can find on the Croquet list. I've not seen the security error 
>you mention.
>
>Laurence
>On 5/7/07, Eric Eisaman 
><<mailto:eric.eisaman at gmail.com>eric.eisaman at gmail.com> wrote:
>Hello,
>
>You mention Croquet as offering alternatives. I have been trying to 
>run Croquet on several different computers but always receive the 
>"Failed to Initiate OpenGL" error however, I recently installed the 
>latest OpenGL on all my computers. Do you know how to deal with 
>this? Also, I get a security error saying my Win32 platform has no 
>good source of entropy. How can I cope with this? If you have any 
>advice I would greatly appreciate it.
>
>Eric Eisaman
>
>
>On 4/1/07, Laurence Rozier <<mailto:laurence.rozier at gmail.com> 
>laurence.rozier at gmail.com> wrote:
>
>On 3/31/07, Young-Jin Lee <<mailto:youngjin.michael at gmail.com> 
>youngjin.michael at gmail.com> wrote:
>Hi,
>
>I am a newbie trying to learn Squeak.
>The squeak book and tutorials says that I need to define a local
>variable using a pipe like below:
>
>| someMuppet |
>someMuppet := Muppet new.
>someMuppet name: 'Elmo'.
>someMuppet greet.
>
>But when I tried the same code without defining a local variable shown
>below, I got the expected results, which makes me wonder when I should
>define a local variable.
>
>anotherMuppet := Muppet new.
>anotherMuppet name: 'Gookie Monster'.
>anotherMuppet greet.
>
>My guess is that I need not define a local variable if my code is
>being executed within a Workspace because all variables such as
>anotherMuppet will have "Workspace" scope.
>
>
>On the surface this is correct, but the language has no explicit 
>notion of "Workspace" scope. If you take a look at the comment in 
>the Class Workspace you can get a sense of how Workspaces end up 
>with this and other interesting/useful behavior as a result of 
>having the ide written in the language.  Smalltalk/Squeak is more 
>than the grammar, it is an environment - the whole is greater than 
>the sum of the parts. Often we do type source code into text editors 
>as with other languages but eToys, Connectors, Croquet and other 
>tools offer alternatives. Depending on what language background 
>you're coming from this may be a subtle but very liberating 
>observation. You may not need to dig into this but if it seems 
>interesting to you, as you use different code editing tools in the 
>environment, try your code above or evaluate the word self.
>
>Enjoy!
>
>Laurence
>
>Can anyone please explain in more detail about variable scopes?
>
>Thanks in advance.
>
>Young-Jin Lee
>_______________________________________________
>Squeakland mailing list
><mailto:Squeakland at squeakland.org>Squeakland at squeakland.org
>http://squeakland.org/mailman/listinfo/squeakland
>
>
>
>_______________________________________________
>Squeakland mailing list
><mailto:Squeakland at squeakland.org>Squeakland at squeakland.org
>http://squeakland.org/mailman/listinfo/squeakland
>
>
>
>_______________________________________________
>Squeakland mailing list
>Squeakland at squeakland.org
>http://squeakland.org/mailman/listinfo/squeakland
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://squeakland.org/pipermail/squeakland/attachments/20070520/1c9d4ea2/attachment-0001.htm


More information about the Squeakland mailing list