[Squeakland] When to define a local variable

Eric Eisaman eric.eisaman at gmail.com
Mon May 7 19:06:29 PDT 2007


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 <laurence.rozier at gmail.com> wrote:
>
>
> On 3/31/07, Young-Jin Lee <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, Croquetand 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
> > 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/20070508/80c3e51c/attachment.htm


More information about the Squeakland mailing list