This code segment works for the presenter, Huw, at https://youtu.be/8ibI5bfssCU?list=PLZHx5heVfgEvuveKG1T7BBSuDOTHl1eLl&t=1...
but it fails for me.
The Screen grab shows my code and error on left and working code on right.
What am I missing? Please be gentle ;-) [image: image.png]
Hi Igor,
I have the impression that you ran some code that is not shown in the screenshot and that that code changed your a to #(0 0 0 0), i.e.:
{ 0 . 0 . 0 . 0 }
Try this:
a := { 1 . 2 . 3 . 4 . 5 }. a at: 5.
a := { 0 . 0 . 0 . 0 }. a at: 5.
Btw, have you tried the "Terse Guide to Squeak"? You can access it with:
Help -> Terse Guide to Squeak
or by running this in a workspace:
HelpBrowser openOn: TerseGuideHelp.
It runs in a "HelpBrowser", and note that the window in which it displays each topic is almost a "mini-workspace" in this sense,
http://anggtwu.net/SQUEAK/squeak-by-example-5.3.pdf
but it doesn't support local variables. I am beginner too, but a few days ago I asked lots of questions about how these local variables work, and I learned how to create Help Browsers that support local variables... the main ideas are in this thread:
http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223560....
Cheers =), Eduardo Ochs http://anggtwu.net/eev-squeak.html
On Sat, 4 Mar 2023 at 20:09, Igor Raven igorraven1@gmail.com wrote:
This code segment works for the presenter, Huw, at https://youtu.be/8ibI5bfssCU?list=PLZHx5heVfgEvuveKG1T7BBSuDOTHl1eLl&t=1...
but it fails for me.
The Screen grab shows my code and error on left and working code on right.
What am I missing? Please be gentle ;-) [image: image.png]
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Oops, I forgot the "#page=49"! The right link is: http://anggtwu.net/SQUEAK/squeak-by-example-5.3.pdf#page=49
On Sat, 4 Mar 2023 at 21:11, Eduardo Ochs eduardoochs@gmail.com wrote:
Hi Igor,
I have the impression that you ran some code that is not shown in the screenshot and that that code changed your a to #(0 0 0 0), i.e.:
{ 0 . 0 . 0 . 0 }
Try this:
a := { 1 . 2 . 3 . 4 . 5 }. a at: 5.
a := { 0 . 0 . 0 . 0 }. a at: 5.
Btw, have you tried the "Terse Guide to Squeak"? You can access it with:
Help -> Terse Guide to Squeak
or by running this in a workspace:
HelpBrowser openOn: TerseGuideHelp.
It runs in a "HelpBrowser", and note that the window in which it displays each topic is almost a "mini-workspace" in this sense,
http://anggtwu.net/SQUEAK/squeak-by-example-5.3.pdf
but it doesn't support local variables. I am beginner too, but a few days ago I asked lots of questions about how these local variables work, and I learned how to create Help Browsers that support local variables... the main ideas are in this thread:
http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223560....
Cheers =), Eduardo Ochs http://anggtwu.net/eev-squeak.html
On Sat, 4 Mar 2023 at 20:09, Igor Raven igorraven1@gmail.com wrote:
This code segment works for the presenter, Huw, at https://youtu.be/8ibI5bfssCU?list=PLZHx5heVfgEvuveKG1T7BBSuDOTHl1eLl&t=1...
but it fails for me.
The Screen grab shows my code and error on left and working code on right.
What am I missing? Please be gentle ;-) [image: image.png]
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Thank you
On Sat, Mar 4, 2023 at 4:13 PM Eduardo Ochs eduardoochs@gmail.com wrote:
Oops, I forgot the "#page=49"! The right link is: http://anggtwu.net/SQUEAK/squeak-by-example-5.3.pdf#page=49
On Sat, 4 Mar 2023 at 21:11, Eduardo Ochs eduardoochs@gmail.com wrote:
Hi Igor,
I have the impression that you ran some code that is not shown in the screenshot and that that code changed your a to #(0 0 0 0), i.e.:
{ 0 . 0 . 0 . 0 }
Try this:
a := { 1 . 2 . 3 . 4 . 5 }. a at: 5.
a := { 0 . 0 . 0 . 0 }. a at: 5.
Btw, have you tried the "Terse Guide to Squeak"? You can access it with:
Help -> Terse Guide to Squeak
or by running this in a workspace:
HelpBrowser openOn: TerseGuideHelp.
It runs in a "HelpBrowser", and note that the window in which it displays each topic is almost a "mini-workspace" in this sense,
http://anggtwu.net/SQUEAK/squeak-by-example-5.3.pdf
but it doesn't support local variables. I am beginner too, but a few days ago I asked lots of questions about how these local variables work, and I learned how to create Help Browsers that support local variables... the main ideas are in this thread:
http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223560....
Cheers =), Eduardo Ochs http://anggtwu.net/eev-squeak.html
On Sat, 4 Mar 2023 at 20:09, Igor Raven igorraven1@gmail.com wrote:
This code segment works for the presenter, Huw, at https://youtu.be/8ibI5bfssCU?list=PLZHx5heVfgEvuveKG1T7BBSuDOTHl1eLl&t=1...
but it fails for me.
The Screen grab shows my code and error on left and working code on right.
What am I missing? Please be gentle ;-) [image: image.png]
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
I don't know if you've solved this already, but what I notice in your screenshot is you only have the loop code highlighted.
I tried reproducing what you're talking about, and the closest I got was when I initialized (evaluated) i and sum, but not a. So, include all the locals in what you highlight, before getting to the loop.
If you don't evaluate the initialization of the locals, the workspace doesn't know they exist.
---Mark mmille10@comcast.net
On 03/04/2023 4:09 PM Igor Raven <igorraven1@gmail.com> wrote: This code segment works for the presenter, Huw, at https://youtu.be/8ibI5bfssCU?list=PLZHx5heVfgEvuveKG1T7BBSuDOTHl1eLl&t=1481 but it fails for me. The Screen grab shows my code and error on left and working code on right. What am I missing? Please be gentle ;-) [image.png] _______________________________________________ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Thank you for the response.
As you can see from the screenshot
a and i
have values displayed in blue. They have been initialized. The portion highlighted is to get (sum) value to print.
I did get it to work but only after closing this instance of the code and re-initializing in a new window.
The code looks same to me but in the new instance it worked.
There must've been something in the memory cash they got corrupted or it was just a small gremlin having its way with me.
On Sat, Mar 4, 2023 at 6:30 PM MARK MILLER mmille10@comcast.net wrote:
I don't know if you've solved this already, but what I notice in your screenshot is you only have the loop code highlighted.
I tried reproducing what you're talking about, and the closest I got was when I initialized (evaluated) i and sum, but not a. So, include all the locals in what you highlight, before getting to the loop.
If you don't evaluate the initialization of the locals, the workspace doesn't know they exist.
---Mark mmille10@comcast.net
On 03/04/2023 4:09 PM Igor Raven igorraven1@gmail.com wrote:
This code segment works for the presenter, Huw, at https://youtu.be/8ibI5bfssCU?list=PLZHx5heVfgEvuveKG1T7BBSuDOTHl1eLl&t=1...
but it fails for me.
The Screen grab shows my code and error on left and working code on right.
What am I missing? Please be gentle ;-) [image: image.png]
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@lists.squeakfoundation.org