From limitcase at gmail.com Wed May 4 17:48:39 2016 From: limitcase at gmail.com (Michael Rice) Date: Wed May 4 19:10:28 2016 Subject: [Newbies] Subclassing PasteUpMorph Message-ID: I'm experimenting with subclassing PasteUpMorph to get some additional behavior. One thing I want to do is have my subclass open with a CircleMorph at 0@0. I already get that behavior, the CircleMorph in the upper left corner, but want my subclass' origin to be at its center, and the CircleMorph drawn there. My current initialize method, initialize "" super initialize. self originAtCenter; addMorph: ((CircleMorph new) color: Color white) centeredNear: 0@0. still places it in the upper left corner. How do I get the origin, 0@0, at the center? My only other method, so far, sets my subclass default bounds. defaultBounds "answer the default bounds for the receiver" ^ 0 @ 0 corner: 400 @ 400 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160504/59994a8c/attachment-0001.htm From bert at freudenbergs.de Fri May 6 14:33:44 2016 From: bert at freudenbergs.de (Bert Freudenberg) Date: Fri May 6 14:57:46 2016 Subject: [Newbies] Subclassing PasteUpMorph In-Reply-To: References: Message-ID: <60CA1303-5555-4758-AA0F-D8A575468822@freudenbergs.de> On 04.05.2016, at 19:48, Michael Rice wrote: > > I'm experimenting with subclassing PasteUpMorph to get some additional behavior. One thing I want to do is have my subclass open with a CircleMorph at 0@0. I already get that behavior, the CircleMorph in the upper left corner, but want my subclass' origin to be at its center, and the CircleMorph drawn there. My current initialize method, > > initialize > "" > > super initialize. > self originAtCenter; addMorph: ((CircleMorph new) color: Color white) centeredNear: 0@0. > > still places it in the upper left corner. > > How do I get the origin, 0@0, at the center? You could use circle x: 0 y: 0. The originAtCenter flag only affects the PasteUpMorph?s cartesianOrigin which is used by Etoys (via the x/y methods) and puts the origin at either its lowerLeft corner or its center, just as in Math (and unlike Squeak). That said, Morphic currently does not use a fully transform-based graphics engine. You cannot easily transform the coordinate system for submorphs. Etoys gets around this by applying the origin offset in its x/y accessors (which also flip the y direction from downwards to upwards). - Bert - -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4207 bytes Desc: not available Url : http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160506/8b44f84d/smime.bin From limitcase at gmail.com Fri May 6 17:00:19 2016 From: limitcase at gmail.com (Michael Rice) Date: Fri May 6 18:37:01 2016 Subject: [Newbies] Subclassing PasteUpMorph In-Reply-To: <60CA1303-5555-4758-AA0F-D8A575468822@freudenbergs.de> References: <60CA1303-5555-4758-AA0F-D8A575468822@freudenbergs.de> Message-ID: A morph is a morph, of course, of course Unless the morph is an Etoys morph Got it. Thanks! On Fri, May 6, 2016 at 10:33 AM, Bert Freudenberg wrote: > On 04.05.2016, at 19:48, Michael Rice wrote: > > > > I'm experimenting with subclassing PasteUpMorph to get some additional > behavior. One thing I want to do is have my subclass open with a > CircleMorph at 0@0. I already get that behavior, the CircleMorph in the > upper left corner, but want my subclass' origin to be at its center, and > the CircleMorph drawn there. My current initialize method, > > > > initialize > > "" > > > > super initialize. > > self originAtCenter; addMorph: ((CircleMorph new) color: Color > white) centeredNear: 0@0. > > > > still places it in the upper left corner. > > > > How do I get the origin, 0@0, at the center? > > You could use > > circle x: 0 y: 0. > > The originAtCenter flag only affects the PasteUpMorph?s cartesianOrigin > which is used by Etoys (via the x/y methods) and puts the origin at either > its lowerLeft corner or its center, just as in Math (and unlike Squeak). > > That said, Morphic currently does not use a fully transform-based graphics > engine. You cannot easily transform the coordinate system for submorphs. > Etoys gets around this by applying the origin offset in its x/y accessors > (which also flip the y direction from downwards to upwards). > > - Bert - > > > > > _______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160506/127a3934/attachment.htm From overcomer.man at gmail.com Fri May 6 19:02:52 2016 From: overcomer.man at gmail.com (Kirk Fraser) Date: Fri May 6 19:57:15 2016 Subject: [Newbies] Machine gun the Balloon! Message-ID: Byte magazine which published the balloon concept for Smalltalk rising above the ivory tower of a lighthouse guiding the way in a sea of computer languages is out of business. I think it is time for the Squeak balloon to be grounded to connect with the reality of why computer languages exist - to make things easy for application developers. So I propose all Squeak developers stop "improving" Squeak for one year and spend the time writing useful applications in Squeak. That could lead to a basket of new ideas for next year. Maybe make this a regularly scheduled event - a half year for applications and a half year for Squeak? The reason motivating this suggestion is on the advice of a Squeak-Dev member, I downloaded the latest all in one and to my chagrin, I found an improvement that made Squeak as worthless as a balloon full of machine gun holes. The Workspace window gets halos with a right mouse click on a standard 2 button laptop mouse. So I'll return to an older Squeak for now. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160506/9b94787f/attachment.htm From joseph.alotta at gmail.com Fri May 6 20:23:57 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Fri May 6 21:17:47 2016 Subject: [Newbies] Re: Machine gun the Balloon! In-Reply-To: References: Message-ID: <3C912E38-5E1A-40FE-95C7-2DB734CBB7D3@gmail.com> I am a beginner with Squeak and the problem I am facing is not knowing how to go about using the tools available. There is a lot of language information, but not a ?here?s what we do? best practices for developers. I don?t mean coding, but I mean, how to find the resource I need. How to build your project in pieces that you can test, etc. What I was looking for is an Apprentice kind of relationship, but nobody seems interested or nearby. Sincerely, Joe. > On May 6, 2016, at 1:35 PM, Kirk Fraser [via Smalltalk] wrote: > > Byte magazine which published the balloon concept for Smalltalk rising above the ivory tower of a lighthouse guiding the way in a sea of computer languages is out of business. I think it is time for the Squeak balloon to be grounded to connect with the reality of why computer languages exist - to make things easy for application developers. So I propose all Squeak developers stop "improving" Squeak for one year and spend the time writing useful applications in Squeak. That could lead to a basket of new ideas for next year. Maybe make this a regularly scheduled event - a half year for applications and a half year for Squeak? > > The reason motivating this suggestion is on the advice of a Squeak-Dev member, I downloaded the latest all in one and to my chagrin, I found an improvement that made Squeak as worthless as a balloon full of machine gun holes. The Workspace window gets halos with a right mouse click on a standard 2 button laptop mouse. So I'll return to an older Squeak for now. > > _______________________________________________ > Beginners mailing list > [hidden email] > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > If you reply to this email, your message will be added to the discussion below: > http://forum.world.st/Machine-gun-the-Balloon-tp4893792.html > To start a new topic under Squeak - Beginners, email ml-node+s1294792n107673h12@n4.nabble.com > To unsubscribe from Squeak - Beginners, click here. > NAML -- View this message in context: http://forum.world.st/Machine-gun-the-Balloon-tp4893792p4893802.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160506/162473fe/attachment-0001.htm From offray at riseup.net Fri May 6 22:15:00 2016 From: offray at riseup.net (=?UTF-8?Q?Offray_Vladimir_Luna_C=c3=a1rdenas?=) Date: Fri May 6 22:42:48 2016 Subject: [Newbies] Re: Machine gun the Balloon! In-Reply-To: <3C912E38-5E1A-40FE-95C7-2DB734CBB7D3@gmail.com> References: <3C912E38-5E1A-40FE-95C7-2DB734CBB7D3@gmail.com> Message-ID: <572D1764.9050405@riseup.net> Hi, I was in a similar situation years ago, but this was deeply with Pharo (which started as a fork of Squeak in 2009). If you want developer related documentation you could see: http://files.pharo.org/books/ Cheers, Offray On 06/05/16 15:23, Joseph Alotta wrote: > I am a beginner with Squeak and the problem I am facing is not knowing > how to go about using the tools available. > > There is a lot of language information, but not a ?here?s what we do? > best practices for developers. I don?t mean coding, but I mean, how > to find the resource I need. How to build your project in pieces that > you can test, etc. > > What I was looking for is an Apprentice kind of relationship, but > nobody seems interested or nearby. > > Sincerely, > > Joe. > > > > > > On May 6, 2016, at 1:35 PM, Kirk Fraser [via Smalltalk] <[hidden > email] > wrote: > > > > Byte magazine which published the balloon concept for Smalltalk > rising above the ivory tower of a lighthouse guiding the way in a sea > of computer languages is out of business. I think it is time for the > Squeak balloon to be grounded to connect with the reality of why > computer languages exist - to make things easy for application > developers. So I propose all Squeak developers stop "improving" > Squeak for one year and spend the time writing useful applications in > Squeak. That could lead to a basket of new ideas for next year. > Maybe make this a regularly scheduled event - a half year for > applications and a half year for Squeak? > > > > The reason motivating this suggestion is on the advice of a > Squeak-Dev member, I downloaded the latest all in one and to my > chagrin, I found an improvement that made Squeak as worthless as a > balloon full of machine gun holes. The Workspace window gets halos > with a right mouse click on a standard 2 button laptop mouse. So I'll > return to an older Squeak for now. > > > > _______________________________________________ > > Beginners mailing list > > [hidden email] > > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > > > > If you reply to this email, your message will be added to the > discussion below: > > http://forum.world.st/Machine-gun-the-Balloon-tp4893792.html > > To start a new topic under Squeak - Beginners, email [hidden email] > > > To unsubscribe from Squeak - Beginners, click here. > > NAML > > > ------------------------------------------------------------------------ > View this message in context: Re: Machine gun the Balloon! > > Sent from the Squeak - Beginners mailing list archive > at Nabble.com. > > > _______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160506/9c39ef0c/attachment.htm From pbpublist at gmail.com Fri May 6 23:30:17 2016 From: pbpublist at gmail.com (Phil (list)) Date: Sat May 7 00:03:20 2016 Subject: [Newbies] Re: Machine gun the Balloon! In-Reply-To: <3C912E38-5E1A-40FE-95C7-2DB734CBB7D3@gmail.com> References: <3C912E38-5E1A-40FE-95C7-2DB734CBB7D3@gmail.com> Message-ID: <1462577417.2547.249.camel@gmail.com> Joe, On Fri, 2016-05-06 at 13:23 -0700, Joseph Alotta wrote: > I am a beginner with Squeak and the problem I am facing is not > knowing how to go about using the tools available.? Having gone through this myself not too many years ago, yet before things really started to get crazy (in good and bad ways) in the Squeak world, I appreciate what you're saying. ?Squeak and its dialects can seem pretty impenetrable until you learn 'the basics' which unfortunately are a bit of a moving target (esp. re: the tools and UI) depending on what you're trying to learn/do. > > There is a lot of language information, but not a ?here?s what we do? > best practices for developers. ?I don?t mean coding, but I mean, how > to find the resource I need. ?How to build your project in pieces > that you can test, etc. ?? This is where things probably get pretty tough once you get beyond the absolute basics. ?In its effort to get better, things are constantly being broken in ways that are often no big deal once you get over the hump and learn your way around. ?However, they're changing enough to 'break' a lot of the existing tutorials and they're changing often enough that said tutorials don't seem to be getting updated to reflect the changes in later releases. ?As if this weren't enough, there are factions with different views on overall direction which directly impacts things like best practices and is why we have different 'distros' ala Squeak/Pharo/Cuis/etc. > What I was looking for is an Apprentice kind of relationship, but > nobody seems interested or nearby.? > That's probably going to be difficult as Smalltalk has a very small population of programmers vs. other languages. ?So getting someone with experience to spend 1-on-1 time with is going to be difficult and/or expensive. ?Your best bet to get started is to read the mailing lists (I would recommend this list, squeak-dev, and cuis as they are all good places to ask basic questions) and just ask when you get stuck. ?There are a few good written works you can use as a starting point (you might want to check out something from?http://wiki.squeak.org/squeak/792) and there are several people who have put together some good intro material on YouTube (For example Lawson English?https://www.youtube.com/playlist ?list=PL6601A198DF14788D?and the late James Robertson?https://www.youtu be.com/playlist?list=PL61A023880D3529DB?have put together some basic stuff that should be helpful) Something I'd highly recommend: if you find a tutorial you like, find out what version of whatever dialect they based the tutorial on and try to use that *exact* version (or at least get as close as you can: if something was written with Squeak 3.x in mind, don't use Squeak 4.x to try to follow along etc.) ?This will minimize the pain of trying to mentally map the tutorial to a different VM/image with even a slightly different feature set and UI. ?When you're just getting started, that's not the time you want to be worried about using the bleeding edge VM or image. ?If you can't figure out what version to use, post details and ask on the lists as either someone who used it or possibly even the person who created it might be reading. >? > Sincerely,? > > Joe.? > Hope this helps, Phil > > > > > On May 6, 2016, at 1:35 PM, Kirk Fraser [via Smalltalk] <[hidden > email]> wrote:? > >? > > Byte magazine which published the balloon concept for Smalltalk > rising above the ivory tower of a lighthouse guiding the way in a sea > of computer languages is out of business. I think it is time for the > Squeak balloon to be grounded to connect with the reality of why > computer languages exist - to make things easy for application > developers. ?So I propose all Squeak developers stop "improving" > Squeak for one year and spend the time writing useful applications in > Squeak. ?That could lead to a basket of new ideas for next year. > ?Maybe make this a regularly scheduled event - a half year for > applications and a half year for Squeak?? > >? > > The reason motivating this suggestion is on the advice of a Squeak- > Dev member, I downloaded the latest all in one and to my chagrin, I > found an improvement that made Squeak as worthless as a balloon full > of machine gun holes. ? ?The Workspace window gets halos with a right > mouse click on a standard 2 button laptop mouse. ?So I'll return to > an older Squeak for now. ?? > >? > > _______________________________________________? > > Beginners mailing list? > > [hidden email]? > > http://lists.squeakfoundation.org/mailman/listinfo/beginners > >? > >? > > If you reply to this email, your message will be added to the > discussion below:? > > http://forum.world.st/Machine-gun-the-Balloon-tp4893792.html > > To start a new topic under Squeak - Beginners, email [hidden > email]? > > To unsubscribe from Squeak - Beginners, click here.? > > NAML > > > View this message in context: Re: Machine gun the Balloon! > Sent from the Squeak - Beginners mailing list archive at Nabble.com. > _______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners From overcomer.man at gmail.com Sat May 7 05:50:54 2016 From: overcomer.man at gmail.com (Kirk Fraser) Date: Sat May 7 06:55:37 2016 Subject: [Newbies] Re: Machine gun the Balloon! In-Reply-To: <1462577417.2547.249.camel@gmail.com> References: <3C912E38-5E1A-40FE-95C7-2DB734CBB7D3@gmail.com> <1462577417.2547.249.camel@gmail.com> Message-ID: Newbies, I learned by examining a Dictionary until I understood how it works and that got me a job. I also got a little help from an old college chum after I started a Smalltalk special interest group of the Portland PC Club. Beyond that it was learning by doing, hiring an offshore consultant for a special project to make a database using a Balanced Tree algorithm (which oddly is not part of Squeak when that one data structure could replace most of the rest of them. Then there was the occasional help by Squeak experts on various things like how to turn off preferences or where to find code to work with a camera. A big help has been focusing my attention on writing a new computer language in Smalltalk which requires lots of work that most programmers never do. But I still can't count myself as an expert because I don't know lots of important things yet like how to use FFI or how to write an FF or how to make Squeak work on a Windows 98 computer which i have to use to run a CNC machine. Experts, my OP was mainly to talk you into doing some real useful work on Squeak instead of aggrandizing yourselves on work that is not truly useful - you know replacing all the collections with a Balanced Tree might be nice or making sharp examples of Secure Sockets or FFI that people can use or get Squeak repaired so it can work on Win 98 or without Halos replacing menus or how to make most of the programs one might download from CNet but I guess it rings a bell with the real newbies that there isn't enough help anywhere. To translate that, I as an intermediate programmer need to be taught how to be senior programmer. So we need better mentoring for everyone. On Fri, May 6, 2016 at 4:30 PM, Phil (list) wrote: > Joe, > > On Fri, 2016-05-06 at 13:23 -0700, Joseph Alotta wrote: > > I am a beginner with Squeak and the problem I am facing is not > > knowing how to go about using the tools available. > > Having gone through this myself not too many years ago, yet before > things really started to get crazy (in good and bad ways) in the Squeak > world, I appreciate what you're saying. Squeak and its dialects can > seem pretty impenetrable until you learn 'the basics' which > unfortunately are a bit of a moving target (esp. re: the tools and UI) > depending on what you're trying to learn/do. > > > > > There is a lot of language information, but not a ?here?s what we do? > > best practices for developers. I don?t mean coding, but I mean, how > > to find the resource I need. How to build your project in pieces > > that you can test, etc. > > This is where things probably get pretty tough once you get beyond the > absolute basics. In its effort to get better, things are constantly > being broken in ways that are often no big deal once you get over the > hump and learn your way around. However, they're changing enough to > 'break' a lot of the existing tutorials and they're changing often > enough that said tutorials don't seem to be getting updated to reflect > the changes in later releases. As if this weren't enough, there are > factions with different views on overall direction which directly > impacts things like best practices and is why we have different > 'distros' ala Squeak/Pharo/Cuis/etc. > > > > What I was looking for is an Apprentice kind of relationship, but > > nobody seems interested or nearby. > > > > That's probably going to be difficult as Smalltalk has a very small > population of programmers vs. other languages. So getting someone with > experience to spend 1-on-1 time with is going to be difficult and/or > expensive. Your best bet to get started is to read the mailing lists > (I would recommend this list, squeak-dev, and cuis as they are all good > places to ask basic questions) and just ask when you get stuck. There > are a few good written works you can use as a starting point (you might > want to check out something from http://wiki.squeak.org/squeak/792) and > there are several people who have put together some good intro material > on YouTube (For example Lawson English https://www.youtube.com/playlist > ?list=PL6601A198DF14788D and the late James Robertson https://www.youtu > be.com/playlist?list=PL61A023880D3529DB have put together some basic > stuff that should be helpful) > > Something I'd highly recommend: if you find a tutorial you like, find > out what version of whatever dialect they based the tutorial on and try > to use that *exact* version (or at least get as close as you can: if > something was written with Squeak 3.x in mind, don't use Squeak 4.x to > try to follow along etc.) This will minimize the pain of trying to > mentally map the tutorial to a different VM/image with even a slightly > different feature set and UI. When you're just getting started, that's > not the time you want to be worried about using the bleeding edge VM or > image. If you can't figure out what version to use, post details and > ask on the lists as either someone who used it or possibly even the > person who created it might be reading. > > > > > Sincerely, > > > > Joe. > > > > Hope this helps, > Phil > > > > > > > > > > On May 6, 2016, at 1:35 PM, Kirk Fraser [via Smalltalk] <[hidden > > email]> wrote: > > > > > > Byte magazine which published the balloon concept for Smalltalk > > rising above the ivory tower of a lighthouse guiding the way in a sea > > of computer languages is out of business. I think it is time for the > > Squeak balloon to be grounded to connect with the reality of why > > computer languages exist - to make things easy for application > > developers. So I propose all Squeak developers stop "improving" > > Squeak for one year and spend the time writing useful applications in > > Squeak. That could lead to a basket of new ideas for next year. > > Maybe make this a regularly scheduled event - a half year for > > applications and a half year for Squeak? > > > > > > The reason motivating this suggestion is on the advice of a Squeak- > > Dev member, I downloaded the latest all in one and to my chagrin, I > > found an improvement that made Squeak as worthless as a balloon full > > of machine gun holes. The Workspace window gets halos with a right > > mouse click on a standard 2 button laptop mouse. So I'll return to > > an older Squeak for now. > > > > > > _______________________________________________ > > > Beginners mailing list > > > [hidden email] > > > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > > > > > > > If you reply to this email, your message will be added to the > > discussion below: > > > http://forum.world.st/Machine-gun-the-Balloon-tp4893792.html > > > To start a new topic under Squeak - Beginners, email [hidden > > email] > > > To unsubscribe from Squeak - Beginners, click here. > > > NAML > > > > > > View this message in context: Re: Machine gun the Balloon! > > Sent from the Squeak - Beginners mailing list archive at Nabble.com. > > _______________________________________________ > > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160506/926d6d57/attachment-0001.htm From joseph.alotta at gmail.com Sat May 7 14:04:08 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Sat May 7 15:14:56 2016 Subject: [Newbies] Re: Machine gun the Balloon! In-Reply-To: References: <3C912E38-5E1A-40FE-95C7-2DB734CBB7D3@gmail.com> <1462577417.2547.249.camel@gmail.com> Message-ID: Kirk, I would be interested in looking at your balance tree algorithm. Do you have some code that I can inspect? Sincerely, Joe. > On May 7, 2016, at 12:42 AM, Kirk Fraser [via Smalltalk] wrote: > > Newbies, I learned by examining a Dictionary until I understood how it works and that got me a job. I also got a little help from an old college chum after I started a Smalltalk special interest group of the Portland PC Club. Beyond that it was learning by doing, hiring an offshore consultant for a special project to make a database using a Balanced Tree algorithm (which oddly is not part of Squeak when that one data structure could replace most of the rest of them. Then there was the occasional help by Squeak experts on various things like how to turn off preferences or where to find code to work with a camera. A big help has been focusing my attention on writing a new computer language in Smalltalk which requires lots of work that most programmers never do. But I still can't count myself as an expert because I don't know lots of important things yet like how to use FFI or how to write an FF or how to make Squeak work on a Windows 98 computer which i have to use to run a CNC machine. > > Experts, my OP was mainly to talk you into doing some real useful work on Squeak instead of aggrandizing yourselves on work that is not truly useful - you know replacing all the collections with a Balanced Tree might be nice or making sharp examples of Secure Sockets or FFI that people can use or get Squeak repaired so it can work on Win 98 or without Halos replacing menus or how to make most of the programs one might download from CNet but I guess it rings a bell with the real newbies that there isn't enough help anywhere. To translate that, I as an intermediate programmer need to be taught how to be senior programmer. So we need better mentoring for everyone. > > > > > > On Fri, May 6, 2016 at 4:30 PM, Phil (list) <[hidden email]>wrote: > Joe, > > On Fri, 2016-05-06 at 13:23 -0700, Joseph Alotta wrote: > > I am a beginner with Squeak and the problem I am facing is not > > knowing how to go about using the tools available. > > Having gone through this myself not too many years ago, yet before > things really started to get crazy (in good and bad ways) in the Squeak > world, I appreciate what you're saying. Squeak and its dialects can > seem pretty impenetrable until you learn 'the basics' which > unfortunately are a bit of a moving target (esp. re: the tools and UI) > depending on what you're trying to learn/do. > > > > > There is a lot of language information, but not a ?here?s what we do? > > best practices for developers. I don?t mean coding, but I mean, how > > to find the resource I need. How to build your project in pieces > > that you can test, etc. > > This is where things probably get pretty tough once you get beyond the > absolute basics. In its effort to get better, things are constantly > being broken in ways that are often no big deal once you get over the > hump and learn your way around. However, they're changing enough to > 'break' a lot of the existing tutorials and they're changing often > enough that said tutorials don't seem to be getting updated to reflect > the changes in later releases. As if this weren't enough, there are > factions with different views on overall direction which directly > impacts things like best practices and is why we have different > 'distros' ala Squeak/Pharo/Cuis/etc. > > > > What I was looking for is an Apprentice kind of relationship, but > > nobody seems interested or nearby. > > > > That's probably going to be difficult as Smalltalk has a very small > population of programmers vs. other languages. So getting someone with > experience to spend 1-on-1 time with is going to be difficult and/or > expensive. Your best bet to get started is to read the mailing lists > (I would recommend this list, squeak-dev, and cuis as they are all good > places to ask basic questions) and just ask when you get stuck. There > are a few good written works you can use as a starting point (you might > want to check out something from http://wiki.squeak.org/squeak/792) and > there are several people who have put together some good intro material > on YouTube (For example Lawson English https://www.youtube.com/playlist > ?list=PL6601A198DF14788D and the late James Robertson https://www.youtu > be.com/playlist?list=PL61A023880D3529DB have put together some basic > stuff that should be helpful) > > Something I'd highly recommend: if you find a tutorial you like, find > out what version of whatever dialect they based the tutorial on and try > to use that *exact* version (or at least get as close as you can: if > something was written with Squeak 3.x in mind, don't use Squeak 4.x to > try to follow along etc.) This will minimize the pain of trying to > mentally map the tutorial to a different VM/image with even a slightly > different feature set and UI. When you're just getting started, that's > not the time you want to be worried about using the bleeding edge VM or > image. If you can't figure out what version to use, post details and > ask on the lists as either someone who used it or possibly even the > person who created it might be reading. > > > > > Sincerely, > > > > Joe. > > > > Hope this helps, > Phil > > > > > > > > > > On May 6, 2016, at 1:35 PM, Kirk Fraser [via Smalltalk] <[hidden > > email]> wrote: > > > > > > Byte magazine which published the balloon concept for Smalltalk > > rising above the ivory tower of a lighthouse guiding the way in a sea > > of computer languages is out of business. I think it is time for the > > Squeak balloon to be grounded to connect with the reality of why > > computer languages exist - to make things easy for application > > developers. So I propose all Squeak developers stop "improving" > > Squeak for one year and spend the time writing useful applications in > > Squeak. That could lead to a basket of new ideas for next year. > > Maybe make this a regularly scheduled event - a half year for > > applications and a half year for Squeak? > > > > > > The reason motivating this suggestion is on the advice of a Squeak- > > Dev member, I downloaded the latest all in one and to my chagrin, I > > found an improvement that made Squeak as worthless as a balloon full > > of machine gun holes. The Workspace window gets halos with a right > > mouse click on a standard 2 button laptop mouse. So I'll return to > > an older Squeak for now. > > > > > > _______________________________________________ > > > Beginners mailing list > > > [hidden email] > > > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > > > > > > > If you reply to this email, your message will be added to the > > discussion below: > > > http://forum.world.st/Machine-gun-the-Balloon-tp4893792.html > > > To start a new topic under Squeak - Beginners, email [hidden > > email] > > > To unsubscribe from Squeak - Beginners, click here. > > > NAML > > > > > > View this message in context: Re: Machine gun the Balloon! > > Sent from the Squeak - Beginners mailing list archive at Nabble.com. > > _______________________________________________ > > Beginners mailing list > > [hidden email] > > http://lists.squeakfoundation.org/mailman/listinfo/beginners > _______________________________________________ > Beginners mailing list > [hidden email] > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > _______________________________________________ > Beginners mailing list > [hidden email] > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > If you reply to this email, your message will be added to the discussion below: > http://forum.world.st/Machine-gun-the-Balloon-tp4893792p4893831.html > To start a new topic under Squeak - Beginners, email ml-node+s1294792n107673h12@n4.nabble.com > To unsubscribe from Squeak - Beginners, click here. > NAML -- View this message in context: http://forum.world.st/Machine-gun-the-Balloon-tp4893792p4893854.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160507/8da39f61/attachment.htm From overcomer.man at gmail.com Sat May 7 17:09:09 2016 From: overcomer.man at gmail.com (Kirk Fraser) Date: Sat May 7 18:27:58 2016 Subject: [Newbies] Re: Machine gun the Balloon! In-Reply-To: References: <3C912E38-5E1A-40FE-95C7-2DB734CBB7D3@gmail.com> <1462577417.2547.249.camel@gmail.com> Message-ID: Yes but I don't have a website to download from. So I'll send it via email. On Sat, May 7, 2016 at 7:04 AM, Joseph Alotta wrote: > Kirk, > > I would be interested in looking at your balance tree algorithm. > > Do you have some code that I can inspect? > > > Sincerely, > > Joe. > > > > > > On May 7, 2016, at 12:42 AM, Kirk Fraser [via Smalltalk] <[hidden email] > > wrote: > > > > Newbies, I learned by examining a Dictionary until I understood how it > works and that got me a job. I also got a little help from an old college > chum after I started a Smalltalk special interest group of the Portland PC > Club. Beyond that it was learning by doing, hiring an offshore consultant > for a special project to make a database using a Balanced Tree algorithm > (which oddly is not part of Squeak when that one data structure could > replace most of the rest of them. Then there was the occasional help by > Squeak experts on various things like how to turn off preferences or where > to find code to work with a camera. A big help has been focusing my > attention on writing a new computer language in Smalltalk which requires > lots of work that most programmers never do. But I still can't count > myself as an expert because I don't know lots of important things yet like > how to use FFI or how to write an FF or how to make Squeak work on a > Windows 98 computer which i have to use to run a CNC machine. > > > > Experts, my OP was mainly to talk you into doing some real useful work > on Squeak instead of aggrandizing yourselves on work that is not truly > useful - you know replacing all the collections with a Balanced Tree might > be nice or making sharp examples of Secure Sockets or FFI that people can > use or get Squeak repaired so it can work on Win 98 or without Halos > replacing menus or how to make most of the programs one might download from > CNet but I guess it rings a bell with the real newbies that there isn't > enough help anywhere. To translate that, I as an intermediate programmer > need to be taught how to be senior programmer. So we need better > mentoring for everyone. > > > > > > > > > > > > On Fri, May 6, 2016 at 4:30 PM, Phil (list) <[hidden email]>wrote: > > Joe, > > > > On Fri, 2016-05-06 at 13:23 -0700, Joseph Alotta wrote: > > > I am a beginner with Squeak and the problem I am facing is not > > > knowing how to go about using the tools available. > > > > Having gone through this myself not too many years ago, yet before > > things really started to get crazy (in good and bad ways) in the Squeak > > world, I appreciate what you're saying. Squeak and its dialects can > > seem pretty impenetrable until you learn 'the basics' which > > unfortunately are a bit of a moving target (esp. re: the tools and UI) > > depending on what you're trying to learn/do. > > > > > > > > There is a lot of language information, but not a ?here?s what we do? > > > best practices for developers. I don?t mean coding, but I mean, how > > > to find the resource I need. How to build your project in pieces > > > that you can test, etc. > > > > This is where things probably get pretty tough once you get beyond the > > absolute basics. In its effort to get better, things are constantly > > being broken in ways that are often no big deal once you get over the > > hump and learn your way around. However, they're changing enough to > > 'break' a lot of the existing tutorials and they're changing often > > enough that said tutorials don't seem to be getting updated to reflect > > the changes in later releases. As if this weren't enough, there are > > factions with different views on overall direction which directly > > impacts things like best practices and is why we have different > > 'distros' ala Squeak/Pharo/Cuis/etc. > > > > > > > What I was looking for is an Apprentice kind of relationship, but > > > nobody seems interested or nearby. > > > > > > > That's probably going to be difficult as Smalltalk has a very small > > population of programmers vs. other languages. So getting someone with > > experience to spend 1-on-1 time with is going to be difficult and/or > > expensive. Your best bet to get started is to read the mailing lists > > (I would recommend this list, squeak-dev, and cuis as they are all good > > places to ask basic questions) and just ask when you get stuck. There > > are a few good written works you can use as a starting point (you might > > want to check out something from http://wiki.squeak.org/squeak/792) and > > there are several people who have put together some good intro material > > on YouTube (For example Lawson English rel="noreferrer" target="_blank">https://www.youtube.com/playlist > > > ?list=PL6601A198DF14788D and the late James Robertson https://www.youtu > > be.com/playlist?list=PL61A023880D3529DB have put together some basic > > stuff that should be helpful) > > > > Something I'd highly recommend: if you find a tutorial you like, find > > out what version of whatever dialect they based the tutorial on and try > > to use that *exact* version (or at least get as close as you can: if > > something was written with Squeak 3.x in mind, don't use Squeak 4.x to > > try to follow along etc.) This will minimize the pain of trying to > > mentally map the tutorial to a different VM/image with even a slightly > > different feature set and UI. When you're just getting started, that's > > not the time you want to be worried about using the bleeding edge VM or > > image. If you can't figure out what version to use, post details and > > ask on the lists as either someone who used it or possibly even the > > person who created it might be reading. > > > > > > > > Sincerely, > > > > > > Joe. > > > > > > > Hope this helps, > > Phil > > > > > > > > > > > > > > > On May 6, 2016, at 1:35 PM, Kirk Fraser [via Smalltalk] <[hidden > > > email]> wrote: > > > > > > > > Byte magazine which published the balloon concept for Smalltalk > > > rising above the ivory tower of a lighthouse guiding the way in a sea > > > of computer languages is out of business. I think it is time for the > > > Squeak balloon to be grounded to connect with the reality of why > > > computer languages exist - to make things easy for application > > > developers. So I propose all Squeak developers stop "improving" > > > Squeak for one year and spend the time writing useful applications in > > > Squeak. That could lead to a basket of new ideas for next year. > > > Maybe make this a regularly scheduled event - a half year for > > > applications and a half year for Squeak? > > > > > > > > The reason motivating this suggestion is on the advice of a Squeak- > > > Dev member, I downloaded the latest all in one and to my chagrin, I > > > found an improvement that made Squeak as worthless as a balloon full > > > of machine gun holes. The Workspace window gets halos with a right > > > mouse click on a standard 2 button laptop mouse. So I'll return to > > > an older Squeak for now. > > > > > > > > _______________________________________________ > > > > Beginners mailing list > > > > [hidden email] > > > > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > > > > > > > > > > If you reply to this email, your message will be added to the > > > discussion below: > > > > http://forum.world.st/Machine-gun-the-Balloon-tp4893792.html > > > > To start a new topic under Squeak - Beginners, email [hidden > > > email] > > > > To unsubscribe from Squeak - Beginners, click here. > > > > NAML > > > > > > > > > View this message in context: Re: Machine gun the Balloon! > > > Sent from the Squeak - Beginners mailing list archive at Nabble.com. > > > _______________________________________________ > > > Beginners mailing list > > > [hidden email] > > > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > _______________________________________________ > > Beginners mailing list > > [hidden email] > > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > > > > _______________________________________________ > > Beginners mailing list > > [hidden email] > > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > > > > If you reply to this email, your message will be added to the discussion > below: > > http://forum.world.st/Machine-gun-the-Balloon-tp4893792p4893831.html > > To start a new topic under Squeak - Beginners, email [hidden email] > > > To unsubscribe from Squeak - Beginners, click here. > > NAML > > > ------------------------------ > View this message in context: Re: Machine gun the Balloon! > > Sent from the Squeak - Beginners mailing list archive > at Nabble.com. > > _______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160507/10385bcc/attachment-0001.htm From lewis at mail.msen.com Sat May 7 17:38:24 2016 From: lewis at mail.msen.com (David T. Lewis) Date: Sat May 7 18:27:58 2016 Subject: [Newbies] Machine gun the Balloon! In-Reply-To: References: Message-ID: <20160507173824.GA67152@shell.msen.com> On Fri, May 06, 2016 at 12:02:52PM -0700, Kirk Fraser wrote: > Byte magazine which published the balloon concept for Smalltalk rising > above the ivory tower of a lighthouse guiding the way in a sea of computer > languages is out of business. I think it is time for the Squeak balloon to > be grounded to connect with the reality of why computer languages exist - > to make things easy for application developers. I hope that you do not truly believe this, that Squeak should exist for the benefit of application developers. What about the 99.99% of people on the planet who are not application developers? After all, it's not as if the application developers of the world aren't already focusing enough attention on their own self-centered interests, and it's not as though the world really needs yet another software productivity tool. To me that is what makes Squeak special. It is a tool for thinking and learning, and it is accessible at people with all sorts of interests and ideas. It is not just for programmers and application developers. I certainly do not want to discourage anyone from writing useful applications in Squeak, that would be great. It's just that to me, it would be really discouraging if Squeak got turned into a "development tool", and disappointing if people did not see its role as something more than just another programming language. Just my personal POV. Dave From overcomer.man at gmail.com Sat May 7 19:11:19 2016 From: overcomer.man at gmail.com (Kirk Fraser) Date: Sat May 7 20:12:35 2016 Subject: [Newbies] Machine gun the Balloon! In-Reply-To: <20160507173824.GA67152@shell.msen.com> References: <20160507173824.GA67152@shell.msen.com> Message-ID: Dave, You can dismiss it as my own personal mid-life crisis if you like. But as you have offered your suggestions for reprogramming my personal point of view, let me offer some for yours. > What about the 99.99% of people on the planet who are not application developers? I see all people as application developers in the wetware of their own minds and hearts. They all need but not all want help to program themselves to perfection which can unlock miracles that Jesus Christ's gospel speaks of. Although I consider myself world class in Bible analysis, I find nobody cares. So as my time on the planet is limited, I'm using Squeak to build an Artificial Intelligence to encapsulate my level of understanding so children in the future can learn to meet and exceed my skills, which may help end world hunger, poverty, illiteracy,, crime, terrorism, and war. I think part of that vision is what motivated Alan Kay to pour himself into trying to make the world's kids become programmers through EToys and others similarly with Scratch. > To me that is what makes Squeak special. It is a tool for thinking and learning, and it is accessible at people with all sorts of interests and ideas. It is not just for programmers and application developers. Often I must fight my imperfect dreams and pray for the perfect. In this case I suggest analyzing your statement until you understand the oxymoron. I can write a one word text file that is accessible to all sorts of people but so what? What matters is what Squeak can do for me and others who download it. With the 2-3 button mouse preference error Squeak is no better than a screen saver image to the majority even if Squeak is otherwise so good it should have been the first computer language instead of Fortran and thousands of other languages should never have been invented. In the 5 computer stores I frequent, I can't recall seeing a laptop with a 3 button mouse. You are asking me and 99.99% of the world to think so highly of Squeak even in its dysfunctional state that they worship it like the people did in the story of the emperor with no clothes. > It's just that to me, it would be really discouraging if Squeak got turned into a "development tool", and disappointing if people did not see its role as something more than just another programming language. If it is not a superior development tool then it is just another programming language but only when it works. The lack of development in Smalltalk is why it is dying like human languages such as Esperanto or Latin. See http://c2.com/cgi/wiki?WhyIsSmalltalkDead If Squeak gets used in more viral applications then people will get more interested in learning it. Kirk Fraser On Sat, May 7, 2016 at 10:38 AM, David T. Lewis wrote: > On Fri, May 06, 2016 at 12:02:52PM -0700, Kirk Fraser wrote: > > Byte magazine which published the balloon concept for Smalltalk rising > > above the ivory tower of a lighthouse guiding the way in a sea of > computer > > languages is out of business. I think it is time for the Squeak balloon > to > > be grounded to connect with the reality of why computer languages exist - > > to make things easy for application developers. > > I hope that you do not truly believe this, that Squeak should exist for the > benefit of application developers. What about the 99.99% of people on the > planet who are not application developers? > > After all, it's not as if the application developers of the world aren't > already focusing enough attention on their own self-centered interests, > and it's not as though the world really needs yet another software > productivity tool. > > To me that is what makes Squeak special. It is a tool for thinking and > learning, and it is accessible at people with all sorts of interests > and ideas. It is not just for programmers and application developers. > > I certainly do not want to discourage anyone from writing useful > applications in Squeak, that would be great. It's just that to me, it > would be really discouraging if Squeak got turned into a "development > tool", and disappointing if people did not see its role as something > more than just another programming language. > > Just my personal POV. > > Dave > > _______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160507/90b3b382/attachment.htm From lewis at mail.msen.com Sat May 7 21:49:38 2016 From: lewis at mail.msen.com (David T. Lewis) Date: Sat May 7 22:25:53 2016 Subject: [Newbies] Machine gun the Balloon! In-Reply-To: References: <20160507173824.GA67152@shell.msen.com> Message-ID: <20160507214938.GA17519@shell.msen.com> Kirk, I like your ideas about what is a "developer" :-) Thanks, Dave On Sat, May 07, 2016 at 12:11:19PM -0700, Kirk Fraser wrote: > Dave, > > You can dismiss it as my own personal mid-life crisis if you like. But as > you have offered your suggestions for reprogramming my personal point of > view, let me offer some for yours. > > > What about the 99.99% of people on the > planet who are not application developers? > > I see all people as application developers in the wetware of their own > minds and hearts. They all need but not all want help to program > themselves to perfection which can unlock miracles that Jesus Christ's > gospel speaks of. > > Although I consider myself world class in Bible analysis, I find nobody > cares. So as my time on the planet is limited, I'm using Squeak to build an > Artificial Intelligence to encapsulate my level of understanding so > children in the future can learn to meet and exceed my skills, which may > help end world hunger, poverty, illiteracy,, crime, terrorism, and war. > > I think part of that vision is what motivated Alan Kay to pour himself into > trying to make the world's kids become programmers through EToys and others > similarly with Scratch. > > > To me that is what makes Squeak special. It is a tool for thinking and > learning, and it is accessible at people with all sorts of interests and > ideas. It is not just for programmers and application developers. > > Often I must fight my imperfect dreams and pray for the perfect. In this > case I suggest analyzing your statement until you understand the oxymoron. > I can write a one word text file that is accessible to all sorts of people > but so what? What matters is what Squeak can do for me and others who > download it. With the 2-3 button mouse preference error Squeak is no > better than a screen saver image to the majority even if Squeak is > otherwise so good it should have been the first computer language instead > of Fortran and thousands of other languages should never have been > invented. In the 5 computer stores I frequent, I can't recall seeing a > laptop with a 3 button mouse. You are asking me and 99.99% of the world to > think so highly of Squeak even in its dysfunctional state that they worship > it like the people did in the story of the emperor with no clothes. > > > It's just that to me, it would be really discouraging if Squeak got > turned into a "development tool", and disappointing if people did not see > its role as something > more than just another programming language. > > If it is not a superior development tool then it is just another > programming language but only when it works. The lack of development in > Smalltalk is why it is dying like human languages such as Esperanto or > Latin. See > http://c2.com/cgi/wiki?WhyIsSmalltalkDead > If Squeak gets used in more viral applications then people will get more > interested in learning it. > > Kirk Fraser > > > > > > > > On Sat, May 7, 2016 at 10:38 AM, David T. Lewis wrote: > > > On Fri, May 06, 2016 at 12:02:52PM -0700, Kirk Fraser wrote: > > > Byte magazine which published the balloon concept for Smalltalk rising > > > above the ivory tower of a lighthouse guiding the way in a sea of > > computer > > > languages is out of business. I think it is time for the Squeak balloon > > to > > > be grounded to connect with the reality of why computer languages exist - > > > to make things easy for application developers. > > > > I hope that you do not truly believe this, that Squeak should exist for the > > benefit of application developers. What about the 99.99% of people on the > > planet who are not application developers? > > > > After all, it's not as if the application developers of the world aren't > > already focusing enough attention on their own self-centered interests, > > and it's not as though the world really needs yet another software > > productivity tool. > > > > To me that is what makes Squeak special. It is a tool for thinking and > > learning, and it is accessible at people with all sorts of interests > > and ideas. It is not just for programmers and application developers. > > > > I certainly do not want to discourage anyone from writing useful > > applications in Squeak, that would be great. It's just that to me, it > > would be really discouraging if Squeak got turned into a "development > > tool", and disappointing if people did not see its role as something > > more than just another programming language. > > > > Just my personal POV. > > > > Dave > > > > _______________________________________________ > > 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 From offray at riseup.net Sun May 8 17:21:29 2016 From: offray at riseup.net (=?UTF-8?Q?Offray_Vladimir_Luna_C=c3=a1rdenas?=) Date: Sun May 8 17:21:34 2016 Subject: ***SPAM*** Re: [Newbies] Machine gun the Balloon! In-Reply-To: <20160507173824.GA67152@shell.msen.com> References: <20160507173824.GA67152@shell.msen.com> Message-ID: <572F7599.6000707@riseup.net> Hi, For me the idea of the computer as tool at the service of creative human spirit and for children from 6 to 100 years, stated by the Smalltalk creators, mean that we should have a continuum between children, developers, other adults, elders, build with Smalltalk. Because this is not possible yet, what we have are several projects like Squeak, Cuis and Pharo, inspired by Smalltalk and serving different interest and people. Despite of not being ideal, this is far better that having "Squeak for children" and non Smalltalk technologies for everything else. In this way you can choose your Smalltalk inspired/based environment for you and the people you're (co-)designing for, without the wars between serving one as precluding the possibility to serving the others. Cheers, Offray On 07/05/16 12:38, David T. Lewis wrote: > On Fri, May 06, 2016 at 12:02:52PM -0700, Kirk Fraser wrote: >> Byte magazine which published the balloon concept for Smalltalk rising >> above the ivory tower of a lighthouse guiding the way in a sea of computer >> languages is out of business. I think it is time for the Squeak balloon to >> be grounded to connect with the reality of why computer languages exist - >> to make things easy for application developers. > I hope that you do not truly believe this, that Squeak should exist for the > benefit of application developers. What about the 99.99% of people on the > planet who are not application developers? > > After all, it's not as if the application developers of the world aren't > already focusing enough attention on their own self-centered interests, > and it's not as though the world really needs yet another software > productivity tool. > > To me that is what makes Squeak special. It is a tool for thinking and > learning, and it is accessible at people with all sorts of interests > and ideas. It is not just for programmers and application developers. > > I certainly do not want to discourage anyone from writing useful > applications in Squeak, that would be great. It's just that to me, it > would be really discouraging if Squeak got turned into a "development > tool", and disappointing if people did not see its role as something > more than just another programming language. > > Just my personal POV. > > Dave > > _______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners > From joseph.alotta at gmail.com Mon May 9 17:51:16 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Mon May 9 17:51:21 2016 Subject: [Newbies] next or break in a loop Message-ID: Greetings, I am in need of a way to go to the end of a do loop. myCollection do: [ :item | (blah blah) ifTrue: ?we found an item of the first type? next item. (blah blah) ifTrue: ?we found an item of the second type? next item. (blah blah) ifTrue: ?we found an item of the third type? next item. (blah blah) ifTrue: ?we found an item of the fourth type? next item. (blah blah) ifTrue: ?we found an item of the fifth type? ]. Some other languages have ?break? or ?next? or ?goto LABEL? to skip the processing of the rest of the loop in case the item is found in the first test. How do I implement this in Squeak? Sincerely, Joe. PS. This is not a homework project. From pbpublist at gmail.com Mon May 9 18:35:56 2016 From: pbpublist at gmail.com (Phil (list)) Date: Mon May 9 18:36:01 2016 Subject: [Newbies] next or break in a loop In-Reply-To: References: Message-ID: <1462818956.2547.323.camel@gmail.com> On Mon, 2016-05-09 at 12:51 -0500, Joseph Alotta wrote: > Greetings, > > I am in need of a way to go to the end of a do loop. > > myCollection do:??[ :item | > > ????????????????(blah blah) ifTrue: ?we found an item of the first > type? > ?????????????????next item. > > ????????????????(blah blah) ifTrue: ?we found an item of the second > type? > ?????????????????next item. > ? > ????????????????(blah blah) ifTrue: ?we found an item of the third > type? > ????????????????next item. > ?? > ????????????????(blah blah) ifTrue: ?we found an item of the fourth > type? > ????????????????next item. > > ????????????????(blah blah) ifTrue: ?we found an item of the fifth > type? > > ]. > > > Some other languages have ?break? or ?next? or ?goto LABEL? to skip > the processing of the rest of the loop in case the item is found in > the first test. > > How do I implement this in Squeak? > Smalltalk doesn't have a switch/case statement but there are a few ways to implement the equivalent logic: 1) Nest the additional conditions inside ifFalse: statements: cond1 ifTrue: [trueLogic...] ifFalse: [cond2? ifTrue: [trueLogic]? ifFalse: [otherLogic...]] This is the simplest method but can get hard to follow/edit pretty quickly re: brackets and formatting. ?You could also add a 'done' variable to avoid the nesting (and avoid multiple conditions from being satisfied in a single pass): done:=false. cond1 ifTrue: [trueLogic. ?done:=true]. (cond2 and: [done not]) ifTrue: [trueLogic. ?done:=true]. (cond3 and: [done not]) ifTrue: [trueLogic. ?done:=true]. done ifFalse: [otherLogic]. 2) Store the conditional blocks as values in a dictionary: switchBlock := Dictionary new at: condValue1 put: [block1]; at: condValue2 put: [block2]; at: condValue3 put: [block3]; yourself. then to evaluate it: (switchBlock at: condValue) value 3) Implement a switch method and call it: switchMethod: switchVal switchVal = cond1 ifTrue: [trueLogic. ?^ whatever]. switchVal = cond2 ifTrue: [trueLogic. ?^ whatever]. swit chVal = cond3 ifTrue: [trueLogic. ?^ whatever]. otherLogic This is one area where I wish Smalltalk had nicer syntax / syntactic sugar for... any of the above is a bit clunky and you need it often enough where this can get tedious. > Sincerely, > > Joe. > > > PS.??This is not a homework project. > > > > _______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners From bert at freudenbergs.de Mon May 9 18:51:23 2016 From: bert at freudenbergs.de (Bert Freudenberg) Date: Mon May 9 18:51:27 2016 Subject: [Newbies] next or break in a loop In-Reply-To: <1462818956.2547.323.camel@gmail.com> References: <1462818956.2547.323.camel@gmail.com> Message-ID: <94C52CCD-AD2D-49F5-BB10-7FF7597465FC@freudenbergs.de> On 09.05.2016, at 20:35, Phil (list) wrote: > > Smalltalk doesn't have a switch/case statement True, but Squeak does: aValue caseOf: { [firstValue] -> [firstBlock]. [secondValue] -> [secondBlock]. } otherwise: [elseBlock] - Bert - -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4207 bytes Desc: not available Url : http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160509/ee7a2abb/smime.bin From A.Wacknitz at gmx.de Mon May 9 18:57:41 2016 From: A.Wacknitz at gmx.de (Andreas Wacknitz) Date: Mon May 9 18:57:46 2016 Subject: [Newbies] next or break in a loop In-Reply-To: References: Message-ID: <2d4f8271-e6a4-d943-1731-7eb1705018db@gmx.de> Am 09.05.16 um 19:51 schrieb Joseph Alotta: > Greetings, > > I am in need of a way to go to the end of a do loop. > > myCollection do: [ :item | > > (blah blah) ifTrue: ?we found an item of the first type? > next item. > > (blah blah) ifTrue: ?we found an item of the second type? > next item. > > (blah blah) ifTrue: ?we found an item of the third type? > next item. > > (blah blah) ifTrue: ?we found an item of the fourth type? > next item. > > (blah blah) ifTrue: ?we found an item of the fifth type? > > ]. > > > Some other languages have ?break? or ?next? or ?goto LABEL? to skip the processing of the rest of the loop in case the item is found in the first test. > > How do I implement this in Squeak? I don't have a good answer for your problem. Smalltalk offers a great interface for iterating over collections, >>do: is not the only one. Alas there is no-one I am aware of that supports what is needed here (something like a split into different sub-collections). >>select: could be used to get all the items for one of your conditions. Thus, for your problem you would need five select:-loops, which is sub-optimal performance-wise. Maybe your problem can be rephrased such that Smalltalk's collection interface offers a better solution. Nevertheless, I suggest to take a closer look at the remaining selectors like >>select:, >>reject:, >>collect, ... Regards Andreas From pbpublist at gmail.com Mon May 9 19:13:50 2016 From: pbpublist at gmail.com (Phil (list)) Date: Mon May 9 19:13:54 2016 Subject: [Newbies] next or break in a loop In-Reply-To: <94C52CCD-AD2D-49F5-BB10-7FF7597465FC@freudenbergs.de> References: <1462818956.2547.323.camel@gmail.com> <94C52CCD-AD2D-49F5-BB10-7FF7597465FC@freudenbergs.de> Message-ID: <1462821230.2547.334.camel@gmail.com> On Mon, 2016-05-09 at 20:51 +0200, Bert Freudenberg wrote: > On 09.05.2016, at 20:35, Phil (list) wrote: > > > > > > Smalltalk doesn't have a switch/case statement > True, but Squeak does: > > aValue caseOf: { > [firstValue] -> [firstBlock]. > [secondValue] -> [secondBlock]. > } otherwise: [elseBlock] > > - Bert - > Hah... learn something new every day (I don't remember noticing that method before.) This is definitely an improvement. > > > _______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners From Das.Linux at gmx.de Mon May 9 19:15:32 2016 From: Das.Linux at gmx.de (Tobias Pape) Date: Mon May 9 19:15:32 2016 Subject: [Newbies] next or break in a loop In-Reply-To: References: Message-ID: <57CC291F-98BA-45DA-9466-805941DF7FE8@gmx.de> Hi Joseph, On 09.05.2016, at 19:51, Joseph Alotta wrote: > Greetings, > > I am in need of a way to go to the end of a do loop. > > myCollection do: [ :item | > > (blah blah) ifTrue: ?we found an item of the first type? > next item. > > (blah blah) ifTrue: ?we found an item of the second type? > next item. > > (blah blah) ifTrue: ?we found an item of the third type? > next item. > > (blah blah) ifTrue: ?we found an item of the fourth type? > next item. > > (blah blah) ifTrue: ?we found an item of the fifth type? > > ]. Can you go a little into detail? Typically, I'd put whatever is to be done when you "know of what type" your items are into its Class, relying on polymorphism. For example, given you have ducks, cats, and dogs and want them to call, you'd do: Dog>>call self sound: 'Waff Waff'. Cat>>call self sound: 'Meow'. Duck>>call self sound: 'Quak!'. So you can use it like this: {Dog new. Cat new. Dog new. Duck new. Duck new} do: [:animal | animal call]. "=> 'Waff Waff', 'Meow', 'Waff Waff', 'Quak!', 'Quak!' What happens when you have a Centipede that does not call at all? Well, let's assume the animals are organized all together in a common super class, Animal. In Animal, we say Animal>>call ^ self to say a 'generic' animal does not do anything when calling. We could do Centipede>>call ^ self or Centipede>>call ^ super call but that superfluous given Animal>>call. So, what do we have now? {Dog new. Cat new. Centipede new. Dog new. Duck new. Centipede new. Duck new} do: [:animal | animal call]. "=> 'Waff Waff', 'Meow', 'Waff Waff', 'Quak!', 'Quak!' That way, no 'goto' or 'continue' is necessary. Best regards -Tobias From joseph.alotta at gmail.com Mon May 9 21:00:58 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Mon May 9 21:01:02 2016 Subject: [Newbies] Re: next or break in a loop In-Reply-To: <57CC291F-98BA-45DA-9466-805941DF7FE8@gmx.de> References: <57CC291F-98BA-45DA-9466-805941DF7FE8@gmx.de> Message-ID: <9108BFC1-FD23-4CA4-8B09-0183D8CB4E0C@gmail.com> I don?t think any of the solutions work for my case. I want to evaluate several different variable for each step, make calculations and if all of the conditions are met, then skip to the next item, otherwise, do the next step of calculations. The project is reading comma deliminated bank or credit card files, taking a column of data, counting various characters, and trying to determine what kind of data it is. For example, a column of data with two slash characters and eight digits per line is likely to be a date field. A column of data with more than 3 letter characters and a percentage of digits and a percentage of hash signs is likely to be a payee field. A column of data with no spaces, no digits, no special characters is likely to be a type of transaction field. A column of data with one period per item, and only digits or a minus sign is likely to be a amount field, and a column of data with a high percentage of zero length items and the rest having C or K and a pound sign and four or more digits is likely to be a check number field. I am doing a lot of tests for each field and I don?t think the switch is a good fit. Sincerely, Joe. From A.Wacknitz at gmx.de Mon May 9 21:13:11 2016 From: A.Wacknitz at gmx.de (Andreas Wacknitz) Date: Mon May 9 21:13:14 2016 Subject: [Newbies] Re: next or break in a loop In-Reply-To: <9108BFC1-FD23-4CA4-8B09-0183D8CB4E0C@gmail.com> References: <57CC291F-98BA-45DA-9466-805941DF7FE8@gmx.de> <9108BFC1-FD23-4CA4-8B09-0183D8CB4E0C@gmail.com> Message-ID: <79bd272c-90a1-d3d3-0b39-d7c6c7e2e649@gmx.de> Am 09.05.16 um 23:00 schrieb Joseph Alotta: > I don?t think any of the solutions work for my case. > > I want to evaluate several different variable for each step, make calculations and if all of the conditions are met, then skip to the next item, otherwise, do the next step of calculations. > > The project is reading comma deliminated bank or credit card files, taking a column of data, counting various characters, and trying to determine what kind of data it is. For example, a column of data with two slash characters and eight digits per line is likely to be a date field. A column of data with more than 3 letter characters and a percentage of digits and a percentage of hash signs is likely to be a payee field. A column of data with no spaces, no digits, no special characters is likely to be a type of transaction field. A column of data with one period per item, and only digits or a minus sign is likely to be a amount field, and a column of data with a high percentage of zero length items and the rest having C or K and a pound sign and four or more digits is likely to be a check number field. > > I am doing a lot of tests for each field and I don?t think the switch is a good fit. > What you probably need is a parser for the things you want to detect and consume. SmaCC or PetitParser comes to my mind... Regards Andreas From bert at freudenbergs.de Mon May 9 21:28:37 2016 From: bert at freudenbergs.de (Bert Freudenberg) Date: Mon May 9 21:28:40 2016 Subject: [Newbies] Re: next or break in a loop In-Reply-To: <9108BFC1-FD23-4CA4-8B09-0183D8CB4E0C@gmail.com> References: <57CC291F-98BA-45DA-9466-805941DF7FE8@gmx.de> <9108BFC1-FD23-4CA4-8B09-0183D8CB4E0C@gmail.com> Message-ID: <77C7D18E-0C66-48AF-87A9-2FAF6EF0A86B@freudenbergs.de> > On 09.05.2016, at 23:00, Joseph Alotta wrote: > > I don?t think any of the solutions work for my case. > > I want to evaluate several different variable for each step, make calculations and if all of the conditions are met, then skip to the next item, otherwise, do the next step of calculations. > > The project is reading comma deliminated bank or credit card files, taking a column of data, counting various characters, and trying to determine what kind of data it is. For example, a column of data with two slash characters and eight digits per line is likely to be a date field. A column of data with more than 3 letter characters and a percentage of digits and a percentage of hash signs is likely to be a payee field. A column of data with no spaces, no digits, no special characters is likely to be a type of transaction field. A column of data with one period per item, and only digits or a minus sign is likely to be a amount field, and a column of data with a high percentage of zero length items and the rest having C or K and a pound sign and four or more digits is likely to be a check number field. > > I am doing a lot of tests for each field and I don?t think the switch is a good fit. Sounds like my first suggestion would work then. Create a method ?processColumn:? that tries to match each pattern and, if successful, reads the data and returns. This should work, but you would have to put a lot of code into one single method, which is bad style. Better to have a set of parsing methods (e.g. parseAsDate:, parseAsPayee: etc) that would return true if they succeeded, and if not, the next one would be tried. And instead of having a couple of methods you could have a couple of parser classes that each would try to parse the item. You would put the parsers in a collection and try each of them until one successfully parsed. This would probably be the most object-oriented solution. - Bert - -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4207 bytes Desc: not available Url : http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160509/bd8ff317/smime.bin From Lou at Keystone-Software.com Mon May 9 21:27:33 2016 From: Lou at Keystone-Software.com (Louis LaBrunda) Date: Mon May 9 21:31:14 2016 Subject: [Newbies] next or break in a loop References: <57CC291F-98BA-45DA-9466-805941DF7FE8@gmx.de> <9108BFC1-FD23-4CA4-8B09-0183D8CB4E0C@gmail.com> Message-ID: <2sv1jbpdnck8dh79d3u52s7kepav01dose@4ax.com> Hi Joe, You can map your collection to a stream and then use the stream methods to traverse the collection. stream := ReadStream on: myCollection. [stream atEnd] whileFalse: [:item | item := stream next. "I'm not sure upToEnd is the right method here but it is close. Look around, I'm sure you will find what you need." item doSomeWork. (when you think you are done with item) ifTrue: [stream upToEnd]. ]. Lou On Mon, 9 May 2016 16:00:58 -0500, Joseph Alotta wrote: >I don?t think any of the solutions work for my case. > >I want to evaluate several different variable for each step, make calculations and if all of the conditions are met, then skip to the next item, otherwise, do the next step of calculations. > >The project is reading comma deliminated bank or credit card files, taking a column of data, counting various characters, and trying to determine what kind of data it is. For example, a column of data with two slash characters and eight digits per line is likely to be a date field. A column of data with more than 3 letter characters and a percentage of digits and a percentage of hash signs is likely to be a payee field. A column of data with no spaces, no digits, no special characters is likely to be a type of transaction field. A column of data with one period per item, and only digits or a minus sign is likely to be a amount field, and a column of data with a high percentage of zero length items and the rest having C or K and a pound sign and four or more digits is likely to be a check number field. > >I am doing a lot of tests for each field and I don?t think the switch is a good fit. > >Sincerely, > >Joe. -- Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon From pbpublist at gmail.com Mon May 9 22:14:59 2016 From: pbpublist at gmail.com (Phil (list)) Date: Mon May 9 22:15:03 2016 Subject: [Newbies] Re: next or break in a loop In-Reply-To: <9108BFC1-FD23-4CA4-8B09-0183D8CB4E0C@gmail.com> References: <57CC291F-98BA-45DA-9466-805941DF7FE8@gmx.de> <9108BFC1-FD23-4CA4-8B09-0183D8CB4E0C@gmail.com> Message-ID: <1462832099.2547.347.camel@gmail.com> On Mon, 2016-05-09 at 16:00 -0500, Joseph Alotta wrote: > The project is reading comma deliminated bank or credit card files, It sounds like you're processing something along the lines of Quicken/MS Money data files that you download from your bank / credit card company. ?If that's the case, Andreas' solution re: a parser would be the way I'd go. From joseph.alotta at gmail.com Tue May 10 15:57:03 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Tue May 10 16:32:13 2016 Subject: [Newbies] Re: next or break in a loop In-Reply-To: <2sv1jbpdnck8dh79d3u52s7kepav01dose@4ax.com> References: <57CC291F-98BA-45DA-9466-805941DF7FE8@gmx.de> <9108BFC1-FD23-4CA4-8B09-0183D8CB4E0C@gmail.com> <2sv1jbpdnck8dh79d3u52s7kepav01dose@4ax.com> Message-ID: Lou, I was trying to use the ReadStream, but the issue is to get execution to go back to the top. If I send the upToEnd message, it still executes from the same line and goes through the rest of the tests. Sincerely, Joe. > On May 9, 2016, at 3:56 PM, Louis LaBrunda [via Smalltalk] wrote: > > Hi Joe, > > You can map your collection to a stream and then use the stream methods to traverse the > collection. > > stream := ReadStream on: myCollection. > [stream atEnd] whileFalse: [:item | > item := stream next. > "I'm not sure upToEnd is the right method here but it is close. Look around, I'm sure you will > find what you need." > item doSomeWork. > (when you think you are done with item) ifTrue: [stream upToEnd]. > ]. > > Lou > > On Mon, 9 May 2016 16:00:58 -0500, Joseph Alotta <[hidden email]> wrote: > > >I don?t think any of the solutions work for my case. > > > >I want to evaluate several different variable for each step, make calculations and if all of the conditions are met, then skip to the next item, otherwise, do the next step of calculations. > > > >The project is reading comma deliminated bank or credit card files, taking a column of data, counting various characters, and trying to determine what kind of data it is. For example, a column of data with two slash characters and eight digits per line is likely to be a date field. A column of data with more than 3 letter characters and a percentage of digits and a percentage of hash signs is likely to be a payee field. A column of data with no spaces, no digits, no special characters is likely to be a type of transaction field. A column of data with one period per item, and only digits or a minus sign is likely to be a amount field, and a column of data with a high percentage of zero length items and the rest having C or K and a pound sign and four or more digits is likely to be a check number field. > > > >I am doing a lot of tests for each field and I don?t think the switch is a good fit. > > > >Sincerely, > > > >Joe. > -- > Louis LaBrunda > Keystone Software Corp. > SkypeMe callto://PhotonDemon > > _______________________________________________ > Beginners mailing list > [hidden email] > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > If you reply to this email, your message will be added to the discussion below: > http://forum.world.st/next-or-break-in-a-loop-tp4894095p4894128.html > To start a new topic under Squeak - Beginners, email ml-node+s1294792n107673h12@n4.nabble.com > To unsubscribe from Squeak - Beginners, click here. > NAML -- View this message in context: http://forum.world.st/next-or-break-in-a-loop-tp4894095p4894218.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160510/8978f301/attachment-0001.htm From Lou at Keystone-Software.com Tue May 10 17:38:24 2016 From: Lou at Keystone-Software.com (Louis LaBrunda) Date: Tue May 10 17:38:35 2016 Subject: [Newbies] next or break in a loop References: <57CC291F-98BA-45DA-9466-805941DF7FE8@gmx.de> <9108BFC1-FD23-4CA4-8B09-0183D8CB4E0C@gmail.com> <2sv1jbpdnck8dh79d3u52s7kepav01dose@4ax.com> Message-ID: Joe, At each test for the type of data you can also test to see if you found type, something like this: stream := ReadStream on: myCollection. [stream atEnd] whileFalse: [:item | | notFound | item := stream next. notFound := true. (notFound and: [your column test1]) ifTrue: [notFound := false. stream upToEnd]. (notFound and: [your column test2]) ifTrue: [notFound := false. stream upToEnd]. (notFound and: [your column test3]) ifTrue: [notFound := false. stream upToEnd]. ]. Not pretty but it should work. You should also look into the #caseOf: method Bert suggested. I have my own Case class in VA Smalltalk that I expect is similar but I'm not familiar with #caseOf:, so you should look it up. I expect it will make the code a little cleaner. Lou On Tue, 10 May 2016 08:57:03 -0700 (PDT), Joseph Alotta wrote: >Lou, > >I was trying to use the ReadStream, but the issue is to get execution to go back to the top. If I send the upToEnd message, it still executes from the same line and goes through the rest of the tests. > > >Sincerely, > >Joe. > > > >> On May 9, 2016, at 3:56 PM, Louis LaBrunda [via Smalltalk] wrote: >> >> Hi Joe, >> >> You can map your collection to a stream and then use the stream methods to traverse the >> collection. >> >> stream := ReadStream on: myCollection. >> [stream atEnd] whileFalse: [:item | >> item := stream next. >> "I'm not sure upToEnd is the right method here but it is close. Look around, I'm sure you will >> find what you need." >> item doSomeWork. >> (when you think you are done with item) ifTrue: [stream upToEnd]. >> ]. >> >> Lou >> >> On Mon, 9 May 2016 16:00:58 -0500, Joseph Alotta <[hidden email]> wrote: >> >> >I don?t think any of the solutions work for my case. >> > >> >I want to evaluate several different variable for each step, make calculations and if all of the conditions are met, then skip to the next item, otherwise, do the next step of calculations. >> > >> >The project is reading comma deliminated bank or credit card files, taking a column of data, counting various characters, and trying to determine what kind of data it is. For example, a column of data with two slash characters and eight digits per line is likely to be a date field. A column of data with more than 3 letter characters and a percentage of digits and a percentage of hash signs is likely to be a payee field. A column of data with no spaces, no digits, no special characters is likely to be a type of transaction field. A column of data with one period per item, and only digits or a minus sign is likely to be a amount field, and a column of data with a high percentage of zero length items and the rest having C or K and a pound sign and four or more digits is likely to be a check number field. >> > >> >I am doing a lot of tests for each field and I don?t think the switch is a good fit. >> > >> >Sincerely, >> > >> >Joe. >> -- >> Louis LaBrunda >> Keystone Software Corp. >> SkypeMe callto://PhotonDemon >> >> _______________________________________________ >> Beginners mailing list >> [hidden email] >> http://lists.squeakfoundation.org/mailman/listinfo/beginners >> >> >> If you reply to this email, your message will be added to the discussion below: >> http://forum.world.st/next-or-break-in-a-loop-tp4894095p4894128.html >> To start a new topic under Squeak - Beginners, email ml-node+s1294792n107673h12@n4.nabble.com >> To unsubscribe from Squeak - Beginners, click here. >> NAML -- Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon From joseph.alotta at gmail.com Tue May 10 18:06:59 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Tue May 10 18:07:03 2016 Subject: [Newbies] new and initialize Message-ID: <7BDEF2BA-5A50-485C-877C-BFBE2F3EC5C2@gmail.com> Greetings, I have an instance method called ?initialize? that defines instance variables. I want it to run whenever a new instance is created. How do I accomplish that? I tried to add a class method ?new? that contained ^(super new) initialize. But it warned me about adding the message saying it would have serious effects. So where do I put it? Sincerely, Joe. From ron at usmedrec.com Tue May 10 18:20:11 2016 From: ron at usmedrec.com (Ron Teitelbaum) Date: Tue May 10 18:20:10 2016 Subject: [Newbies] new and initialize In-Reply-To: <7BDEF2BA-5A50-485C-877C-BFBE2F3EC5C2@gmail.com> References: <7BDEF2BA-5A50-485C-877C-BFBE2F3EC5C2@gmail.com> Message-ID: <087a01d1aae8$98082420$c8186c60$@usmedrec.com> Hi Joe, Excellent question. Try this. Object new. Highlight it and do debug it. Click "Into" to go into the #new method. Notice the implementation of #new. You should be able to see there that #initialize is called automatically. Also for extra points notice what class new is implemented on. What method should you call to skip initialize? All the best, Ron Teitelbaum > -----Original Message----- > From: beginners-bounces@lists.squeakfoundation.org [mailto:beginners- > bounces@lists.squeakfoundation.org] On Behalf Of Joseph Alotta > Sent: Tuesday, May 10, 2016 2:07 PM > To: beginners@lists.squeakfoundation.org > Subject: [Newbies] new and initialize > > Greetings, > > I have an instance method called ?initialize? that defines instance variables. > > I want it to run whenever a new instance is created. How do I accomplish > that? > > I tried to add a class method ?new? that contained ^(super new) initialize. > But it warned me about adding the message saying it would have serious > effects. > > So where do I put it? > > Sincerely, > > Joe. > > > > _______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners From joseph.alotta at gmail.com Tue May 10 19:37:53 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Tue May 10 20:13:04 2016 Subject: [Newbies] Re: new and initialize In-Reply-To: <087a01d1aae8$98082420$c8186c60$@usmedrec.com> References: <7BDEF2BA-5A50-485C-877C-BFBE2F3EC5C2@gmail.com> <087a01d1aae8$98082420$c8186c60$@usmedrec.com> Message-ID: <8A3933DD-2F5D-4C6D-8439-CB2DB2F577ED@gmail.com> > On May 10, 2016, at 12:45 PM, Ron Teitelbaum [via Smalltalk] wrote: > > Hi Joe, > > Excellent question. Try this. > > Object new. > > Highlight it and do debug it. Click "Into" to go into the #new method. > > Notice the implementation of #new. > > You should be able to see there that #initialize is called automatically. > > Also for extra points notice what class new is implemented on. Behavior > What method should you call to skip initialize? basicNew More questions: why isn?t there a command key for debug it? why isn?t my initialize method not running or running without setting variables? Thank you. Sincerely, Joe. -- View this message in context: http://forum.world.st/new-and-initialize-tp4894227p4894237.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160510/69bd20c5/attachment.htm From joseph.alotta at gmail.com Tue May 10 19:44:55 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Tue May 10 20:20:06 2016 Subject: [Newbies] Re: next or break in a loop In-Reply-To: References: <57CC291F-98BA-45DA-9466-805941DF7FE8@gmx.de> <9108BFC1-FD23-4CA4-8B09-0183D8CB4E0C@gmail.com> <2sv1jbpdnck8dh79d3u52s7kepav01dose@4ax.com> Message-ID: <95A01E4E-6988-4340-BFE4-1A47E8264244@gmail.com> > On May 10, 2016, at 12:03 PM, Louis LaBrunda [via Smalltalk] wrote: > > Joe, > > At each test for the type of data you can also test to see if you found type, something like > this: > > stream := ReadStream on: myCollection. > [stream atEnd] whileFalse: [:item | | notFound | > item := stream next. > notFound := true. > (notFound and: [your column test1]) ifTrue: [notFound := false. stream upToEnd]. > (notFound and: [your column test2]) ifTrue: [notFound := false. stream upToEnd]. > (notFound and: [your column test3]) ifTrue: [notFound := false. stream upToEnd]. > ]. > > Not pretty but it should work. I added a flag and set it as one of the conditions. Also, to make reading simpler, I stacked all the booleans. bool := bool and: (condition). bool := bool and: (another condition). It is not pretty, but it avoids endless seas of parentheses. Sincerely, Joe. -- View this message in context: http://forum.world.st/next-or-break-in-a-loop-tp4894095p4894238.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160510/6fc8e8b1/attachment.htm From btc at openinworld.com Tue May 10 23:05:05 2016 From: btc at openinworld.com (Ben Coman) Date: Tue May 10 23:05:27 2016 Subject: [Newbies] Re: new and initialize In-Reply-To: <8A3933DD-2F5D-4C6D-8439-CB2DB2F577ED@gmail.com> References: <7BDEF2BA-5A50-485C-877C-BFBE2F3EC5C2@gmail.com> <087a01d1aae8$98082420$c8186c60$@usmedrec.com> <8A3933DD-2F5D-4C6D-8439-CB2DB2F577ED@gmail.com> Message-ID: On Wed, May 11, 2016 at 3:37 AM, Joseph Alotta wrote: > >> On May 10, 2016, at 12:45 PM, Ron Teitelbaum [via Smalltalk] <[hidden >> email]> wrote: >> >> Hi Joe, >> >> Excellent question. Try this. >> >> Object new. >> >> Highlight it and do debug it. Click "Into" to go into the #new method. >> >> Notice the implementation of #new. >> >> You should be able to see there that #initialize is called automatically. >> >> Also for extra points notice what class new is implemented on. > > Behavior > >> What method should you call to skip initialize? > > basicNew > > More questions: > why isn?t my initialize method not running or running > without setting variables? Is your initialize method on the class-side or the instance-side ? At the very very start of using Squeak this would catch me up. It soon became instinctive to notice which side I was working on. cheers -ben From ron at usmedrec.com Wed May 11 00:03:07 2016 From: ron at usmedrec.com (Ron Teitelbaum) Date: Wed May 11 00:03:04 2016 Subject: [Newbies] Re: new and initialize In-Reply-To: <8A3933DD-2F5D-4C6D-8439-CB2DB2F577ED@gmail.com> References: <7BDEF2BA-5A50-485C-877C-BFBE2F3EC5C2@gmail.com> <087a01d1aae8$98082420$c8186c60$@usmedrec.com> <8A3933DD-2F5D-4C6D-8439-CB2DB2F577ED@gmail.com> Message-ID: <096501d1ab18$7fd47590$7f7d60b0$@usmedrec.com> From: Joseph Alotta Sent: Tuesday, May 10, 2016 3:38 PM > On May 10, 2016, at 12:45 PM, Ron Teitelbaum [via Smalltalk] <[hidden email]> wrote: > > Hi Joe, > > Excellent question. Try this. > > Object new. > > Highlight it and do debug it. Click "Into" to go into the #new method. > > Notice the implementation of #new. > > You should be able to see there that #initialize is called automatically. > > Also for extra points notice what class new is implemented on. Behavior [Ron Teitelbaum] Exactly! > What method should you call to skip initialize? basicNew [Ron Teitelbaum] Excellent! More questions: why isn?t there a command key for debug it? [Ron Teitelbaum] No clue. why isn?t my initialize method not running or running without setting variables? [Ron Teitelbaum] put a halt in your method and run it. See if the initialize is being called at all. If it is then check the content of your method for errors. If not then your initialize method is spelled wrong, is not on the instance side, or there is a new method implemented in your class or a superclass that is bypassing the default implementation of #new which is a bad thing. The system gives you a warning to let you know that!! J All the best, Ron Thank you. Sincerely, Joe. _____ View this message in context: Re: new and initialize Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160510/10f7b079/attachment-0001.htm From cunningham.cb at gmail.com Wed May 11 22:42:42 2016 From: cunningham.cb at gmail.com (Chris Cunningham) Date: Wed May 11 22:42:43 2016 Subject: [Newbies] Re: new and initialize In-Reply-To: <8A3933DD-2F5D-4C6D-8439-CB2DB2F577ED@gmail.com> References: <7BDEF2BA-5A50-485C-877C-BFBE2F3EC5C2@gmail.com> <087a01d1aae8$98082420$c8186c60$@usmedrec.com> <8A3933DD-2F5D-4C6D-8439-CB2DB2F577ED@gmail.com> Message-ID: Hi. On Tue, May 10, 2016 at 12:37 PM, Joseph Alotta wrote: > More questions: why isn?t there a command key for debug it? > I just learned this today - we do have a command key (well, command key sequence) for debug it: Shift+Cmd+D to "Debug it" -cbc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160511/fb0e0c79/attachment.htm From joseph.alotta at gmail.com Wed May 11 23:50:55 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Thu May 12 00:26:15 2016 Subject: [Newbies] Re: new and initialize In-Reply-To: References: <7BDEF2BA-5A50-485C-877C-BFBE2F3EC5C2@gmail.com> <087a01d1aae8$98082420$c8186c60$@usmedrec.com> <8A3933DD-2F5D-4C6D-8439-CB2DB2F577ED@gmail.com> Message-ID: Sorry, it doesn?t work on the Mac. The window gets black and then redraws. I think maybe it means ?refresh?. Sincerely, JOe. > On May 11, 2016, at 5:07 PM, cbc [via Smalltalk] wrote: > > Hi. > > On Tue, May 10, 2016 at 12:37 PM, Joseph Alotta <[hidden email]> wrote: > > More questions: why isn?t there a command key for debug it? > > I just learned this today - we do have a command key (well, command key sequence) for debug it: > > Shift+Cmd+D to "Debug it" > > -cbc > > _______________________________________________ > Beginners mailing list > [hidden email] > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > If you reply to this email, your message will be added to the discussion below: > http://forum.world.st/new-and-initialize-tp4894227p4894371.html > To start a new topic under Squeak - Beginners, email ml-node+s1294792n107673h12@n4.nabble.com > To unsubscribe from Squeak - Beginners, click here. > NAML -- View this message in context: http://forum.world.st/new-and-initialize-tp4894227p4894377.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160511/efe5eb9b/attachment.htm From Das.Linux at gmx.de Thu May 12 08:17:42 2016 From: Das.Linux at gmx.de (Tobias Pape) Date: Thu May 12 08:17:45 2016 Subject: [Newbies] new and initialize In-Reply-To: References: <7BDEF2BA-5A50-485C-877C-BFBE2F3EC5C2@gmail.com> <087a01d1aae8$98082420$c8186c60$@usmedrec.com> <8A3933DD-2F5D-4C6D-8439-CB2DB2F577ED@gmail.com> Message-ID: <6CBFFDDA-9C89-4628-A465-1EB2529F8D94@gmx.de> On 12.05.2016, at 01:50, Joseph Alotta wrote: > Sorry, it doesn?t work on the Mac. The window gets black and then redraws. I think maybe it means ?refresh?. > > Sincerely, > > JOe. Joe, which version of Squeak are you using? 5.0 does not yet have this shortcut but the current development version (trunk / 5.1alpha) does. Best regards -Tobias From digit at sonic.net Thu May 12 17:01:45 2016 From: digit at sonic.net (Tim Johnson) Date: Thu May 12 17:01:53 2016 Subject: [Newbies] Sharing a Singleton for read-only access to data Message-ID: <9456479A-AD69-4B3A-B89D-F5B1354829FE@sonic.net> Hello Squeakers, It is cool that we have this forum for asking these kinds of questions. -- TL;DR -- I learned I probably shouldn't subclass a singleton even though it seemed so easy; I wonder instead how to design my controller properly in an MVC paradigm; should I learn about Factory methods and add them to my singleton?; should I keep query methods out of my data-holding Singletons and move them to new Presenter objects as intermediaries between data-holding Singletons and views?; should I read a book?; should I give up and go home?. -- THE TASK -- I am working on a little Seaside app for my job, with a maximum of ~4 simultaneous users. It started as skunkworks but has proved kind of useful. My model has a couple of singletons for a couple of collections of data represented as (say) MyRecords or XYZRecords. Singletons seemed good because the source materials being parsed into these records are ~4.0 MB apiece, so I don't want multiple copies of the data hanging around, and I only need read-only access. Maybe the singletons could be described like this: #MyReader class "Singleton; Reads some CSV or other formats; parses into MyRecords; makes collections of MyRecords available using different query methods" For a quick-and-dirty solution to get a demo up-and-running to show my boss, I subclassed one of my Singletons (oh no!) as FilteredMyReader and added #filterByYear:, #filterBlock:, and #resetFilter methods. Inside this subclass, I just overrode the accessor for the XYZRecords to something like this: #records ^ records select: (self filterBlock) with some helper methods: #filterByYear: aYear self filterBlock: [:ea | ea year = aYear] ... and #resetFilter ... self filterBlock: [:ea | true ] With these new methods in my subclass, I had a drop-in replacement for my MyReader. It worked great! All of my query-style and-reporting-style methods were still available (because it is a subclass), but because the accessor method now was filtered, they showed only the data I wanted. Woo-hoo! -- BUT THERE CAME TO BE A PROBLEM -- the big problem arose when multiple sessions (multiple users) were accessing the app at the same time. Seasoned Smalltalk vets are sure to chuckle to themselves now, but I am not exactly sure why this happened (subclassing singletons is not threadsafe?). I think when one session would change the filterBlock, it would affect another session's view into the data. So one user may be intending to view 2016 but it may actually show 2012. (When designing this quick-and-dirty solution, I may have mistakenly thought that each Session had a new instance of my new FilteredMyReader subclass, but probably not [!], because it was a subclass of a singleton [!]). So, I have reached the philosophical point where I get to ask "is this is a bug in my implementation, or a flaw in my design?" A quick Google of "subclass a singleton" brings up a number of results akin to "don't do this, but if you have to, here's how: " so I think my quick-and-dirty solution might be at fault. -- SO -- as I ponder whether the flaw is in my implementation or my design, I question whether the proper approach and a working solution would be to stop subclassing the Singleton and instead do one of the following: 1) In the Singleton, keep my query/reporting methods, but instead of returning Bags or OrderedCollections or what-have-you, have them manufacture (like a Factory?) instances of a to-be-created class of object which would be like a 'looking glass' into the data, like an intermediary between the Seaside component and the model. Not sure what the terminology would be -- Presenter? Controller? I think "Art and Science of Smalltalk" (Simon Lewis) might have called it a Presenter or a PluggableSomething. 2) Similar to (1) but skip any interaction between the Singleton and the View/Session altogether. Create a new XYZPresenter or Controller or PluggableSomething class which can have many instances around, without holding copies of the Singleton's data. Create these on-demand from my WASession subclass (controller) or in my components (view). These new objects will interact with the Singleton themselves in a read-only fashion. 3) Give up on Singletons for holding data and keep this stuff in a database outside of the image. My coworkers want a traditional relational database anyway. After writing all of this up, I am still a bit confused how to proceed, because the HPI Seaside tutorial I read many years ago says a WASession subclass is supposed to be my "Controller." So maybe I should leverage /it/ more to access the singletons / model (without storing copies of the data!). But maybe I still would be best served by creating an additional intermediary between my WASession subclass (as controller) and the Singletons (as /part/ of the model). I hope this wasn't too much to follow, and might prove fun and instructive for someone. (Please note that while I may make references to what may be some Design Patterns, I haven't fully read the books or the Smalltalk companion, so I am speaking only with some infantile understanding of what I am talking about.) Thanks, Tim From craig at blackpagedigital.com Thu May 12 13:23:38 2016 From: craig at blackpagedigital.com (Craig Latta) Date: Thu May 12 22:25:15 2016 Subject: [Newbies] re: Need a local tutor for Squeak In-Reply-To: <1459896336969-4888503.post@n4.nabble.com> References: <1459896336969-4888503.post@n4.nabble.com> Message-ID: <5794f5d6-67a8-a7ca-a02c-19668cec4fde@blackpagedigital.com> Hi Joe-- > I need a local person to help me with Squeak Smalltalk. I live in the > Western suburbs of Chicago, in Downers Grove. I want someone to show > me all the things I am missing and to help me use the tools more > effectively. > > I am thinking we could meet at a coffee shop once a week for an > hour. I would pay for each lesson, $70. If you decide you'd be willing to do remote lessons, I'd be happy to help online live from Amsterdam. Success! -C -- Craig Latta Black Page Digital Amsterdam craig@blackpagedigital.com +31 6 2757 7177 (SMS ok) + 1 415 287 3547 (no SMS) From btc at openinworld.com Fri May 13 01:43:35 2016 From: btc at openinworld.com (Ben Coman) Date: Fri May 13 01:43:58 2016 Subject: [Newbies] Sharing a Singleton for read-only access to data In-Reply-To: <9456479A-AD69-4B3A-B89D-F5B1354829FE@sonic.net> References: <9456479A-AD69-4B3A-B89D-F5B1354829FE@sonic.net> Message-ID: Hi Tim, I'm not clear on which of your methods are instance-side or class-side. Can you clarify this using the form.. XYZRecords >> filterByYear -- for instance side XYZRecords class >> filterByYear -- for class side I'm not overly familiar with Seaside or Design Pattern architectures, but it seems you want multiple filter instances accessing one copy of the data. So maybe try putting your data in a class variable. Something like this... Object subclass: #XYZRecords instanceVariableNames: 'filterBlock' classVariableNames: 'Data' ... XYZRecords class >> readFromCSVFile: aFile Data := OrderedCollection new. "for all lines from file..." Data add: ...... XYZRecords >> filterByYear: aYear filterBlock := [ :ea | ea year = aYear] XYZRecords>>records ^ Data select: filterBlock XYZRecords class >> filterByYear: aYear ^self new filterByYear: aYear _Example usage_ XYZRecords readFromCSVFile: '~user/data.csv'. recordset1 := XYZRecords filterByYear: 1971 recordset2 := XYZRecords filterByYear: 2000 recordset1 records inspect. recordset2 records inspect. No need to necessarily reset the filter. You might just throw the recordset instance away. cheers -ben On Fri, May 13, 2016 at 1:01 AM, Tim Johnson wrote: > Hello Squeakers, > > It is cool that we have this forum for asking these kinds of questions. > > -- TL;DR -- I learned I probably shouldn't subclass a singleton even though it seemed so easy; I wonder instead how to design my controller properly in an MVC paradigm; should I learn about Factory methods and add them to my singleton?; should I keep query methods out of my data-holding Singletons and move them to new Presenter objects as intermediaries between data-holding Singletons and views?; should I read a book?; should I give up and go home?. > > -- THE TASK -- I am working on a little Seaside app for my job, with a maximum of ~4 simultaneous users. It started as skunkworks but has proved kind of useful. My model has a couple of singletons for a couple of collections of data represented as (say) MyRecords or XYZRecords. Singletons seemed good because the source materials being parsed into these records are ~4.0 MB apiece, so I don't want multiple copies of the data hanging around, and I only need read-only access. > > Maybe the singletons could be described like this: > > #MyReader class > "Singleton; Reads some CSV or other formats; parses into MyRecords; makes collections of MyRecords available using different query methods" > > > > For a quick-and-dirty solution to get a demo up-and-running to show my boss, I subclassed one of my Singletons (oh no!) as FilteredMyReader and added #filterByYear:, #filterBlock:, and #resetFilter methods. Inside this subclass, I just overrode the accessor for the XYZRecords to something like this: > > #records > ^ records select: (self filterBlock) > > with some helper methods: > > #filterByYear: aYear > self filterBlock: [:ea | ea year = aYear] > > > ... and #resetFilter ... > > self filterBlock: [:ea | true ] > > With these new methods in my subclass, I had a drop-in replacement for my MyReader. It worked great! All of my query-style and-reporting-style methods were still available (because it is a subclass), but because the accessor method now was filtered, they showed only the data I wanted. Woo-hoo! > > -- BUT THERE CAME TO BE A PROBLEM -- the big problem arose when multiple sessions (multiple users) were accessing the app at the same time. Seasoned Smalltalk vets are sure to chuckle to themselves now, but I am not exactly sure why this happened (subclassing singletons is not threadsafe?). I think when one session would change the filterBlock, it would affect another session's view into the data. So one user may be intending to view 2016 but it may actually show 2012. (When designing this quick-and-dirty solution, I may have mistakenly thought that each Session had a new instance of my new FilteredMyReader subclass, but probably not [!], because it was a subclass of a singleton [!]). > > So, I have reached the philosophical point where I get to ask "is this is a bug in my implementation, or a flaw in my design?" A quick Google of "subclass a singleton" brings up a number of results akin to "don't do this, but if you have to, here's how: " so I think my quick-and-dirty solution might be at fault. > > -- SO -- as I ponder whether the flaw is in my implementation or my design, I question whether the proper approach and a working solution would be to stop subclassing the Singleton and instead do one of the following: > > 1) In the Singleton, keep my query/reporting methods, but instead of returning Bags or OrderedCollections or what-have-you, have them manufacture (like a Factory?) instances of a to-be-created class of object which would be like a 'looking glass' into the data, like an intermediary between the Seaside component and the model. Not sure what the terminology would be -- Presenter? Controller? I think "Art and Science of Smalltalk" (Simon Lewis) might have called it a Presenter or a PluggableSomething. > > 2) Similar to (1) but skip any interaction between the Singleton and the View/Session altogether. Create a new XYZPresenter or Controller or PluggableSomething class which can have many instances around, without holding copies of the Singleton's data. Create these on-demand from my WASession subclass (controller) or in my components (view). These new objects will interact with the Singleton themselves in a read-only fashion. > > 3) Give up on Singletons for holding data and keep this stuff in a database outside of the image. My coworkers want a traditional relational database anyway. > > After writing all of this up, I am still a bit confused how to proceed, because the HPI Seaside tutorial I read many years ago says a WASession subclass is supposed to be my "Controller." So maybe I should leverage /it/ more to access the singletons / model (without storing copies of the data!). But maybe I still would be best served by creating an additional intermediary between my WASession subclass (as controller) and the Singletons (as /part/ of the model). > > I hope this wasn't too much to follow, and might prove fun and instructive for someone. (Please note that while I may make references to what may be some Design Patterns, I haven't fully read the books or the Smalltalk companion, so I am speaking only with some infantile understanding of what I am talking about.) > > Thanks, > Tim > > > _______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners From digit at sonic.net Fri May 13 04:03:59 2016 From: digit at sonic.net (Tim Johnson) Date: Fri May 13 04:04:10 2016 Subject: [Newbies] Sharing a Singleton for read-only access to data In-Reply-To: References: <9456479A-AD69-4B3A-B89D-F5B1354829FE@sonic.net> Message-ID: Hi Ben, Good ideas. I think your solution is the way to go. Throwing out the XYZRecords instances when I am done, rather than resetting filters, is a good idea. Keeping the data as a class variable is also a great tip. I was keeping the "Singleton" instance as the class variable instead of just keeping the data like that. Silly. Thanks for the help and for the tip on notation. My current implementation was similar to what you wrote -- with the filtering / querying methods instance-side, and CSV parsing stuff class-side. Best, Tim On May 12, 2016, at 6:43 PM, Ben Coman wrote: > Hi Tim, > > I'm not clear on which of your methods are instance-side or > class-side. Can you clarify this using the form.. > XYZRecords >> filterByYear -- for instance side > XYZRecords class >> filterByYear -- for class side > > I'm not overly familiar with Seaside or Design Pattern architectures, > but it seems you want multiple filter instances accessing one copy of > the data. So maybe try putting your data in a class variable. > Something like this... > > Object subclass: #XYZRecords > instanceVariableNames: 'filterBlock' > classVariableNames: 'Data' > ... > > XYZRecords class >> readFromCSVFile: aFile > Data := OrderedCollection new. > "for all lines from file..." > Data add: ...... > > XYZRecords >> filterByYear: aYear > filterBlock := [ :ea | ea year = aYear] > > XYZRecords>>records > ^ Data select: filterBlock > > XYZRecords class >> filterByYear: aYear > ^self new filterByYear: aYear > > > _Example usage_ > > XYZRecords readFromCSVFile: '~user/data.csv'. > > recordset1 := XYZRecords filterByYear: 1971 > recordset2 := XYZRecords filterByYear: 2000 > > recordset1 records inspect. > recordset2 records inspect. > > No need to necessarily reset the filter. You might just throw the > recordset instance away. > > cheers -ben > > On Fri, May 13, 2016 at 1:01 AM, Tim Johnson wrote: >> Hello Squeakers, >> >> It is cool that we have this forum for asking these kinds of questions. >> >> -- TL;DR -- I learned I probably shouldn't subclass a singleton even though it seemed so easy; I wonder instead how to design my controller properly in an MVC paradigm; should I learn about Factory methods and add them to my singleton?; should I keep query methods out of my data-holding Singletons and move them to new Presenter objects as intermediaries between data-holding Singletons and views?; should I read a book?; should I give up and go home?. >> >> -- THE TASK -- I am working on a little Seaside app for my job, with a maximum of ~4 simultaneous users. It started as skunkworks but has proved kind of useful. My model has a couple of singletons for a couple of collections of data represented as (say) MyRecords or XYZRecords. Singletons seemed good because the source materials being parsed into these records are ~4.0 MB apiece, so I don't want multiple copies of the data hanging around, and I only need read-only access. >> >> Maybe the singletons could be described like this: >> >> #MyReader class >> "Singleton; Reads some CSV or other formats; parses into MyRecords; makes collections of MyRecords available using different query methods" >> >> >> >> For a quick-and-dirty solution to get a demo up-and-running to show my boss, I subclassed one of my Singletons (oh no!) as FilteredMyReader and added #filterByYear:, #filterBlock:, and #resetFilter methods. Inside this subclass, I just overrode the accessor for the XYZRecords to something like this: >> >> #records >> ^ records select: (self filterBlock) >> >> with some helper methods: >> >> #filterByYear: aYear >> self filterBlock: [:ea | ea year = aYear] >> >> >> ... and #resetFilter ... >> >> self filterBlock: [:ea | true ] >> >> With these new methods in my subclass, I had a drop-in replacement for my MyReader. It worked great! All of my query-style and-reporting-style methods were still available (because it is a subclass), but because the accessor method now was filtered, they showed only the data I wanted. Woo-hoo! >> >> -- BUT THERE CAME TO BE A PROBLEM -- the big problem arose when multiple sessions (multiple users) were accessing the app at the same time. Seasoned Smalltalk vets are sure to chuckle to themselves now, but I am not exactly sure why this happened (subclassing singletons is not threadsafe?). I think when one session would change the filterBlock, it would affect another session's view into the data. So one user may be intending to view 2016 but it may actually show 2012. (When designing this quick-and-dirty solution, I may have mistakenly thought that each Session had a new instance of my new FilteredMyReader subclass, but probably not [!], because it was a subclass of a singleton [!]). >> >> So, I have reached the philosophical point where I get to ask "is this is a bug in my implementation, or a flaw in my design?" A quick Google of "subclass a singleton" brings up a number of results akin to "don't do this, but if you have to, here's how: " so I think my quick-and-dirty solution might be at fault. >> >> -- SO -- as I ponder whether the flaw is in my implementation or my design, I question whether the proper approach and a working solution would be to stop subclassing the Singleton and instead do one of the following: >> >> 1) In the Singleton, keep my query/reporting methods, but instead of returning Bags or OrderedCollections or what-have-you, have them manufacture (like a Factory?) instances of a to-be-created class of object which would be like a 'looking glass' into the data, like an intermediary between the Seaside component and the model. Not sure what the terminology would be -- Presenter? Controller? I think "Art and Science of Smalltalk" (Simon Lewis) might have called it a Presenter or a PluggableSomething. >> >> 2) Similar to (1) but skip any interaction between the Singleton and the View/Session altogether. Create a new XYZPresenter or Controller or PluggableSomething class which can have many instances around, without holding copies of the Singleton's data. Create these on-demand from my WASession subclass (controller) or in my components (view). These new objects will interact with the Singleton themselves in a read-only fashion. >> >> 3) Give up on Singletons for holding data and keep this stuff in a database outside of the image. My coworkers want a traditional relational database anyway. >> >> After writing all of this up, I am still a bit confused how to proceed, because the HPI Seaside tutorial I read many years ago says a WASession subclass is supposed to be my "Controller." So maybe I should leverage /it/ more to access the singletons / model (without storing copies of the data!). But maybe I still would be best served by creating an additional intermediary between my WASession subclass (as controller) and the Singletons (as /part/ of the model). >> >> I hope this wasn't too much to follow, and might prove fun and instructive for someone. (Please note that while I may make references to what may be some Design Patterns, I haven't fully read the books or the Smalltalk companion, so I am speaking only with some infantile understanding of what I am talking about.) >> >> Thanks, >> Tim >> >> >> _______________________________________________ >> 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 > From stephan at stack.nl Fri May 13 05:44:30 2016 From: stephan at stack.nl (Stephan Eggermont) Date: Fri May 13 05:44:40 2016 Subject: [Newbies] Re: Sharing a Singleton for read-only access to data In-Reply-To: <9456479A-AD69-4B3A-B89D-F5B1354829FE@sonic.net> References: <9456479A-AD69-4B3A-B89D-F5B1354829FE@sonic.net> Message-ID: Just a small flaw, easy to fix. You can just subclass the session class and add the filter data to that, or you can add user management. In QcMagritte we use announcements and user management, so there we have WASession subclass: #QCSession instanceVariableNames: 'announcer user' classVariableNames: '' category: 'QC-Magritte-Session' with methods like #isLoggedIn ^self user notNil where the seaside application class (class side) does #registerAt: anApplicationName ^(WAAdmin register: self asApplicationAt: anApplicationName) preferenceAt: #sessionClass put: self sessionClass; addLibrary: JQDeploymentLibrary; addLibrary: JQUiDeploymentLibrary; yourself and the seaside component does #isLoggedIn ^self session isLoggedIn If you want the filters to be coupled to the user instead of the session, your users can also be such a singleton collection. Otherwise, just use a session class that holds onto your filter data. Seaside itself (on Squeak and Pharo) is threadsafe Stephan From stephan at stack.nl Fri May 13 07:19:26 2016 From: stephan at stack.nl (Stephan Eggermont) Date: Fri May 13 07:19:52 2016 Subject: [Newbies] Re: Need a local tutor for Squeak In-Reply-To: <5794f5d6-67a8-a7ca-a02c-19668cec4fde@blackpagedigital.com> References: <1459896336969-4888503.post@n4.nabble.com> <5794f5d6-67a8-a7ca-a02c-19668cec4fde@blackpagedigital.com> Message-ID: On 12/05/16 15:23, Craig Latta wrote: > If you decide you'd be willing to do remote lessons, I'd be happy > to help online live from Amsterdam. As I've observed in several smalltalk workshops given at the yearly FOSDEM conference, Craig is very patient and clear in explaining, and has an enormous experience in all things smalltalk. He'd make an excellent tutor. Stephan Eggermont From joseph.alotta at gmail.com Fri May 13 13:14:26 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Fri May 13 13:49:57 2016 Subject: [Newbies] Re: Need a local tutor for Squeak In-Reply-To: References: <1459896336969-4888503.post@n4.nabble.com> <5794f5d6-67a8-a7ca-a02c-19668cec4fde@blackpagedigital.com> Message-ID: <36549ABE-76A4-4C3F-B104-170FA943B8A3@gmail.com> Thanks Stephan and Craig, I will keep it in mind. I haven?t given up on a local tutor yet. Sincerely. Joe. > On May 13, 2016, at 1:44 AM, Stephan Eggermont [via Smalltalk] wrote: > > On 12/05/16 15:23, Craig Latta wrote: > > If you decide you'd be willing to do remote lessons, I'd be happy > > to help online live from Amsterdam. > > As I've observed in several smalltalk workshops given at the yearly > FOSDEM conference, Craig is very patient and clear in explaining, and > has an enormous experience in all things smalltalk. He'd make an > excellent tutor. > > Stephan Eggermont > > > _______________________________________________ > Beginners mailing list > [hidden email] > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > If you reply to this email, your message will be added to the discussion below: > http://forum.world.st/Need-a-local-tutor-for-Squeak-tp4888503p4894581.html > To start a new topic under Squeak - Beginners, email ml-node+s1294792n107673h12@n4.nabble.com > To unsubscribe from Squeak - Beginners, click here. > NAML -- View this message in context: http://forum.world.st/Need-a-local-tutor-for-Squeak-tp4888503p4894645.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160513/496d2fd0/attachment.htm From ron at usmedrec.com Fri May 13 13:59:41 2016 From: ron at usmedrec.com (Ron Teitelbaum) Date: Fri May 13 13:59:42 2016 Subject: [Newbies] Re: Need a local tutor for Squeak In-Reply-To: <36549ABE-76A4-4C3F-B104-170FA943B8A3@gmail.com> References: <1459896336969-4888503.post@n4.nabble.com> <5794f5d6-67a8-a7ca-a02c-19668cec4fde@blackpagedigital.com> <36549ABE-76A4-4C3F-B104-170FA943B8A3@gmail.com> Message-ID: <088b01d1ad1f$b27ec960$177c5c20$@usmedrec.com> Hi Joe and Craig, Not sure if it will help but I?ll donate a Terf space for you to use for lessons. You can drink virtual coffee while learning Squeak in Squeak! J All the best, Ron Teitelbaum Chief Executive Officer 3D Immersive Collaboration Consulting ron@3Dicc.com Follow Me On Twitter: @RonTeitelbaum www.3Dicc.com https://www.google.com/+3Dicc From: beginners-bounces@lists.squeakfoundation.org [mailto:beginners-bounces@lists.squeakfoundation.org] On Behalf Of Joseph Alotta Sent: Friday, May 13, 2016 9:14 AM To: beginners@lists.squeakfoundation.org Subject: [Newbies] Re: Need a local tutor for Squeak Thanks Stephan and Craig, I will keep it in mind. I haven?t given up on a local tutor yet. Sincerely. Joe. > On May 13, 2016, at 1:44 AM, Stephan Eggermont [via Smalltalk] <[hidden email]> wrote: > > On 12/05/16 15:23, Craig Latta wrote: > > If you decide you'd be willing to do remote lessons, I'd be happy > > to help online live from Amsterdam. > > As I've observed in several smalltalk workshops given at the yearly > FOSDEM conference, Craig is very patient and clear in explaining, and > has an enormous experience in all things smalltalk. He'd make an > excellent tutor. > > Stephan Eggermont > > > _______________________________________________ > Beginners mailing list > [hidden email] > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > If you reply to this email, your message will be added to the discussion below: > http://forum.world.st/Need-a-local-tutor-for-Squeak-tp4888503p4894581.html > To start a new topic under Squeak - Beginners, email [hidden email] > To unsubscribe from Squeak - Beginners, click here. > NAML _____ View this message in context: Re: Need a local tutor for Squeak Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160513/6258728d/attachment-0001.htm From joseph.alotta at gmail.com Fri May 13 13:27:26 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Fri May 13 14:02:56 2016 Subject: [Newbies] Re: Need a local tutor for Squeak In-Reply-To: <088b01d1ad1f$b27ec960$177c5c20$@usmedrec.com> References: <1459896336969-4888503.post@n4.nabble.com> <5794f5d6-67a8-a7ca-a02c-19668cec4fde@blackpagedigital.com> <36549ABE-76A4-4C3F-B104-170FA943B8A3@gmail.com> <088b01d1ad1f$b27ec960$177c5c20$@usmedrec.com> Message-ID: <9625F69E-9311-4D88-B013-6987032AD5EA@gmail.com> what?s a terf space? > On May 13, 2016, at 8:24 AM, Ron Teitelbaum [via Smalltalk] wrote: > > Hi Joe and Craig, > > > > Not sure if it will help but I?ll donate a Terf space for you to use for lessons. You can drink virtual coffee while learning Squeak in Squeak! J > > > > All the best, > > > > Ron Teitelbaum > > Chief Executive Officer > > 3D Immersive Collaboration Consulting > > [hidden email] > > Follow Me On Twitter: @RonTeitelbaum > > www.3Dicc.com > > https://www.google.com/+3Dicc > > > > > > From: [hidden email] [mailto:[hidden email]] On Behalf Of Joseph Alotta > Sent: Friday, May 13, 2016 9:14 AM > To: [hidden email] > Subject: [Newbies] Re: Need a local tutor for Squeak > > > > Thanks Stephan and Craig, > > I will keep it in mind. I haven?t given up on a local tutor yet. > > Sincerely. > > Joe. > > > > > > On May 13, 2016, at 1:44 AM, Stephan Eggermont [via Smalltalk] <[hidden email]> wrote: > > > > On 12/05/16 15:23, Craig Latta wrote: > > > If you decide you'd be willing to do remote lessons, I'd be happy > > > to help online live from Amsterdam. > > > > As I've observed in several smalltalk workshops given at the yearly > > FOSDEM conference, Craig is very patient and clear in explaining, and > > has an enormous experience in all things smalltalk. He'd make an > > excellent tutor. > > > > Stephan Eggermont > > > > > > _______________________________________________ > > Beginners mailing list > > [hidden email] > > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > > > > If you reply to this email, your message will be added to the discussion below: > > http://forum.world.st/Need-a-local-tutor-for-Squeak-tp4888503p4894581.html > > To start a new topic under Squeak - Beginners, email [hidden email] > > To unsubscribe from Squeak - Beginners, click here. > > NAML > > > > View this message in context: Re: Need a local tutor for Squeak > > Sent from the Squeak - Beginners mailing list archive at Nabble.com. > > > _______________________________________________ > Beginners mailing list > [hidden email] > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > If you reply to this email, your message will be added to the discussion below: > http://forum.world.st/Need-a-local-tutor-for-Squeak-tp4888503p4894649.html > To start a new topic under Squeak - Beginners, email ml-node+s1294792n107673h12@n4.nabble.com > To unsubscribe from Squeak - Beginners, click here. > NAML -- View this message in context: http://forum.world.st/Need-a-local-tutor-for-Squeak-tp4888503p4894650.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160513/d02d25ad/attachment.htm From ron at usmedrec.com Fri May 13 14:07:29 2016 From: ron at usmedrec.com (Ron Teitelbaum) Date: Fri May 13 14:07:30 2016 Subject: [Newbies] Re: Need a local tutor for Squeak In-Reply-To: <9625F69E-9311-4D88-B013-6987032AD5EA@gmail.com> References: <1459896336969-4888503.post@n4.nabble.com> <5794f5d6-67a8-a7ca-a02c-19668cec4fde@blackpagedigital.com> <36549ABE-76A4-4C3F-B104-170FA943B8A3@gmail.com> <088b01d1ad1f$b27ec960$177c5c20$@usmedrec.com> <9625F69E-9311-4D88-B013-6987032AD5EA@gmail.com> Message-ID: <089f01d1ad20$c982b440$5c881cc0$@usmedrec.com> Hi Joe, Terf is a virtual world used for collaboration. We provide VOIP, webcams, video, document sharing (doc, xls, ppt, pdf, txt), web browsing, sticky notes, 3d objects and more. It?s like being in the same room together. You can even sit at a table with virtual coffee! www.3dicc.com All the best, Ron Teitelbaum From: beginners-bounces@lists.squeakfoundation.org [mailto:beginners-bounces@lists.squeakfoundation.org] On Behalf Of Joseph Alotta Sent: Friday, May 13, 2016 9:27 AM To: beginners@lists.squeakfoundation.org Subject: [Newbies] Re: Need a local tutor for Squeak what?s a terf space? > On May 13, 2016, at 8:24 AM, Ron Teitelbaum [via Smalltalk] <[hidden email]> wrote: > > Hi Joe and Craig, > > > > Not sure if it will help but I?ll donate a Terf space for you to use for lessons. You can drink virtual coffee while learning Squeak in Squeak! J > > > > All the best, > > > > Ron Teitelbaum > > Chief Executive Officer > > 3D Immersive Collaboration Consulting > > [hidden email] > > Follow Me On Twitter: @RonTeitelbaum > > www.3Dicc.com > > https://www.google.com/+3Dicc > > > > > > From: [hidden email] [mailto:[hidden email]] On Behalf Of Joseph Alotta > Sent: Friday, May 13, 2016 9:14 AM > To: [hidden email] > Subject: [Newbies] Re: Need a local tutor for Squeak > > > > Thanks Stephan and Craig, > > I will keep it in mind. I haven?t given up on a local tutor yet. > > Sincerely. > > Joe. > > > > > > On May 13, 2016, at 1:44 AM, Stephan Eggermont [via Smalltalk] <[hidden email]> wrote: > > > > On 12/05/16 15:23, Craig Latta wrote: > > > If you decide you'd be willing to do remote lessons, I'd be happy > > > to help online live from Amsterdam. > > > > As I've observed in several smalltalk workshops given at the yearly > > FOSDEM conference, Craig is very patient and clear in explaining, and > > has an enormous experience in all things smalltalk. He'd make an > > excellent tutor. > > > > Stephan Eggermont > > > > > > _______________________________________________ > > Beginners mailing list > > [hidden email] > > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > > > > If you reply to this email, your message will be added to the discussion below: > > http://forum.world.st/Need-a-local-tutor-for-Squeak-tp4888503p4894581.html > > To start a new topic under Squeak - Beginners, email [hidden email] > > To unsubscribe from Squeak - Beginners, click here. > > NAML > > > > View this message in context: Re: Need a local tutor for Squeak > > Sent from the Squeak - Beginners mailing list archive at Nabble.com. > > > _______________________________________________ > Beginners mailing list > [hidden email] > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > If you reply to this email, your message will be added to the discussion below: > http://forum.world.st/Need-a-local-tutor-for-Squeak-tp4888503p4894649.html > To start a new topic under Squeak - Beginners, email [hidden email] > To unsubscribe from Squeak - Beginners, click here. > NAML _____ View this message in context: Re: Need a local tutor for Squeak Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160513/6b63af51/attachment.htm From lewis at mail.msen.com Fri May 13 14:31:17 2016 From: lewis at mail.msen.com (David T. Lewis) Date: Fri May 13 14:31:19 2016 Subject: [Newbies] Re: Need a local tutor for Squeak In-Reply-To: <088b01d1ad1f$b27ec960$177c5c20$@usmedrec.com> References: <1459896336969-4888503.post@n4.nabble.com> <5794f5d6-67a8-a7ca-a02c-19668cec4fde@blackpagedigital.com> <36549ABE-76A4-4C3F-B104-170FA943B8A3@gmail.com> <088b01d1ad1f$b27ec960$177c5c20$@usmedrec.com> Message-ID: <18077.136.1.1.166.1463149877.squirrel@webmail.msen.com> That's a really good idea! Dave > Hi Joe and Craig, > > > > Not sure if it will help but I???ll donate a Terf space for you to use for > lessons. You can drink virtual coffee while learning Squeak in Squeak! J > > > > All the best, > > > > Ron Teitelbaum > > Chief Executive Officer > > 3D Immersive Collaboration Consulting > > ron@3Dicc.com > > Follow Me On Twitter: @RonTeitelbaum > > www.3Dicc.com > > https://www.google.com/+3Dicc > > > > > > From: beginners-bounces@lists.squeakfoundation.org > [mailto:beginners-bounces@lists.squeakfoundation.org] On Behalf Of Joseph > Alotta > Sent: Friday, May 13, 2016 9:14 AM > To: beginners@lists.squeakfoundation.org > Subject: [Newbies] Re: Need a local tutor for Squeak > > > > Thanks Stephan and Craig, > > I will keep it in mind. I haven???t given up on a local tutor yet. > > Sincerely. > > Joe. > > > > >> On May 13, 2016, at 1:44 AM, Stephan Eggermont [via Smalltalk] <[hidden >> email]> wrote: >> >> On 12/05/16 15:23, Craig Latta wrote: >> > If you decide you'd be willing to do remote lessons, I'd be happy >> > to help online live from Amsterdam. >> >> As I've observed in several smalltalk workshops given at the yearly >> FOSDEM conference, Craig is very patient and clear in explaining, and >> has an enormous experience in all things smalltalk. He'd make an >> excellent tutor. >> >> Stephan Eggermont >> >> >> _______________________________________________ >> Beginners mailing list >> [hidden email] >> http://lists.squeakfoundation.org/mailman/listinfo/beginners >> >> >> If you reply to this email, your message will be added to the discussion >> below: >> http://forum.world.st/Need-a-local-tutor-for-Squeak-tp4888503p4894581.html >> To start a new topic under Squeak - Beginners, email [hidden email] >> To unsubscribe from Squeak - Beginners, click here. >> NAML > > > > _____ > > View this message in context: Re: Need a local tutor for Squeak > > Sent from the Squeak - Beginners mailing list archive > at Nabble.com. > > _______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners > From joseph.alotta at gmail.com Fri May 13 16:51:11 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Fri May 13 16:51:15 2016 Subject: [Newbies] '1921' romanNumber Message-ID: Shouldn?t this work? '1921? romanNumber I get an error index out of bounds. Sincerely, Joe. From ron at usmedrec.com Fri May 13 18:19:55 2016 From: ron at usmedrec.com (Ron Teitelbaum) Date: Fri May 13 18:19:57 2016 Subject: [Newbies] '1921' romanNumber In-Reply-To: References: Message-ID: <099b01d1ad44$0dfc1260$29f43720$@usmedrec.com> Hi Joe! Try this: 'MCMXXI' romanNumber I would think that 1921 asRomanNumerals (or asRomanNumber) would be a cool method to write! I checked but don't see one :). Ron > -----Original Message----- > From: beginners-bounces@lists.squeakfoundation.org [mailto:beginners- > bounces@lists.squeakfoundation.org] On Behalf Of Joseph Alotta > Sent: Friday, May 13, 2016 12:51 PM > To: beginners@lists.squeakfoundation.org > Subject: [Newbies] '1921' romanNumber > > Shouldn?t this work? > > > '1921? romanNumber > > > I get an error index out of bounds. > > Sincerely, > > Joe._______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners From dnorton at mindspring.com Fri May 13 18:28:39 2016 From: dnorton at mindspring.com (Dan Norton) Date: Fri May 13 18:28:48 2016 Subject: [Newbies] '1921' romanNumber In-Reply-To: References: Message-ID: <57361CD7.7298.CBB196@dnorton.mindspring.com> On 13 May 2016 at 11:51, Joseph Alotta wrote: > Shouldn?t this work? > > > '1921? romanNumber > > > I get an error index out of bounds. > > Sincerely, > > Joe. Gee, whatever gave you that idea :-) Try the following to see how it was intended: 'MCML' romanNumber. If ever there was a method that needs renaming and a comment, #romanNumber is it. - Dan From jecel at merlintec.com Fri May 13 19:32:59 2016 From: jecel at merlintec.com (Jecel Assumpcao Jr.) Date: Fri May 13 19:33:06 2016 Subject: [Newbies] '1921' romanNumber In-Reply-To: <099b01d1ad44$0dfc1260$29f43720$@usmedrec.com> References: <099b01d1ad44$0dfc1260$29f43720$@usmedrec.com> Message-ID: <20160513193303.7D335BF3216DA@bart0111.email.locaweb.com.br> Ron, > I would think that 1921 asRomanNumerals (or > asRomanNumber) would be a cool method to write! > > I checked but don't see one :). 1921 printStringRoman I found that out by trying "roman" in the search field. The method finder said that no single method could go from 1921 to 'MCMXXI' but since it also didn't find #romanNumber I decided I had to look for method names instead. -- Jecel From ron at usmedrec.com Fri May 13 20:00:32 2016 From: ron at usmedrec.com (Ron Teitelbaum) Date: Fri May 13 20:00:35 2016 Subject: [Newbies] '1921' romanNumber In-Reply-To: <20160513193303.7D335BF3216DA@bart0111.email.locaweb.com.br> References: <099b01d1ad44$0dfc1260$29f43720$@usmedrec.com> <20160513193303.7D335BF3216DA@bart0111.email.locaweb.com.br> Message-ID: <09f701d1ad52$1b4d2860$51e77920$@usmedrec.com> Hi Jecel, HAHAHA! I figured it was there somewhere. I looked for omanNumber :). Well done Jecel! All the best, Ron > From: Jecel Assumpcao Jr. > Sent: Friday, May 13, 2016 3:33 PM > > Ron, > > > I would think that 1921 asRomanNumerals (or > > asRomanNumber) would be a cool method to write! > > > > I checked but don't see one :). > > 1921 printStringRoman > > I found that out by trying "roman" in the search field. The method finder > said that no single method could go from 1921 to 'MCMXXI' but since it also > didn't find #romanNumber I decided I had to look for method names > instead. > > -- Jecel > _______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners From nicolas.cellier.aka.nice at gmail.com Fri May 13 20:32:59 2016 From: nicolas.cellier.aka.nice at gmail.com (nicolas cellier) Date: Fri May 13 20:33:13 2016 Subject: [Newbies] Re: '1921' romanNumber References: <099b01d1ad44$0dfc1260$29f43720$@usmedrec.com> Message-ID: Ron Teitelbaum usmedrec.com> writes: > > Hi Joe! > > Try this: > > 'MCMXXI' romanNumber > > I would think that 1921 asRomanNumerals (or asRomanNumber) would be a cool method to write! > > I checked but don't see one :). > > Ron > 1921 printStringRoman. It's not referenced in MethodFinder, so it can't be found that easily. Nicolas From ron at usmedrec.com Fri May 13 21:32:59 2016 From: ron at usmedrec.com (Ron Teitelbaum) Date: Fri May 13 21:32:59 2016 Subject: [Newbies] Re: '1921' romanNumber In-Reply-To: References: <099b01d1ad44$0dfc1260$29f43720$@usmedrec.com> Message-ID: <0a4c01d1ad5f$0615b7c0$12412740$@usmedrec.com> Thanks Nicolas. Jecel pointed it out too. I figured it had to be there but yeah I didn't see it either. Ron > -----Original Message----- > From: nicolas cellier > Sent: Friday, May 13, 2016 4:33 PM > > Ron Teitelbaum usmedrec.com> writes: > > > > > Hi Joe! > > > > Try this: > > > > 'MCMXXI' romanNumber > > > > I would think that 1921 asRomanNumerals (or asRomanNumber) would be > a cool > method to write! > > > > I checked but don't see one :). > > > > Ron > > > > 1921 printStringRoman. > > It's not referenced in MethodFinder, so it can't be found that easily. > > Nicolas > > > _______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners From lewis at mail.msen.com Sat May 14 16:57:44 2016 From: lewis at mail.msen.com (David T. Lewis) Date: Sat May 14 16:57:45 2016 Subject: [Newbies] Re: Need a local tutor for Squeak In-Reply-To: <9625F69E-9311-4D88-B013-6987032AD5EA@gmail.com> References: <1459896336969-4888503.post@n4.nabble.com> <5794f5d6-67a8-a7ca-a02c-19668cec4fde@blackpagedigital.com> <36549ABE-76A4-4C3F-B104-170FA943B8A3@gmail.com> <088b01d1ad1f$b27ec960$177c5c20$@usmedrec.com> <9625F69E-9311-4D88-B013-6987032AD5EA@gmail.com> Message-ID: <20160514165744.GA79712@shell.msen.com> On Fri, May 13, 2016 at 06:27:26AM -0700, Joseph Alotta wrote: > what???s a terf space? > You can see it here: http://www.3dicc.com/product-details/ Dave > > > > On May 13, 2016, at 8:24 AM, Ron Teitelbaum [via Smalltalk] wrote: > > > > Hi Joe and Craig, > > > > > > > > Not sure if it will help but I???ll donate a Terf space for you to use for lessons. You can drink virtual coffee while learning Squeak in Squeak! J > > > > > > > > All the best, > > > > > > > > Ron Teitelbaum > > > > Chief Executive Officer > > > > 3D Immersive Collaboration Consulting > > > > [hidden email] > > > > Follow Me On Twitter: @RonTeitelbaum > > > > www.3Dicc.com > > > > https://www.google.com/+3Dicc > > > > > > > > > > > > From: [hidden email] [mailto:[hidden email]] On Behalf Of Joseph Alotta > > Sent: Friday, May 13, 2016 9:14 AM > > To: [hidden email] > > Subject: [Newbies] Re: Need a local tutor for Squeak > > > > > > > > Thanks Stephan and Craig, > > > > I will keep it in mind. I haven???t given up on a local tutor yet. > > > > Sincerely. > > > > Joe. > > > > > > > > > > > On May 13, 2016, at 1:44 AM, Stephan Eggermont [via Smalltalk] <[hidden email]> wrote: > > > > > > On 12/05/16 15:23, Craig Latta wrote: > > > > If you decide you'd be willing to do remote lessons, I'd be happy > > > > to help online live from Amsterdam. > > > > > > As I've observed in several smalltalk workshops given at the yearly > > > FOSDEM conference, Craig is very patient and clear in explaining, and > > > has an enormous experience in all things smalltalk. He'd make an > > > excellent tutor. > > > > > > Stephan Eggermont > > > > > > > > > _______________________________________________ > > > Beginners mailing list > > > [hidden email] > > > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > > > > > > > If you reply to this email, your message will be added to the discussion below: > > > http://forum.world.st/Need-a-local-tutor-for-Squeak-tp4888503p4894581.html > > > To start a new topic under Squeak - Beginners, email [hidden email] > > > To unsubscribe from Squeak - Beginners, click here. > > > NAML > > > > > > > > View this message in context: Re: Need a local tutor for Squeak > > > > Sent from the Squeak - Beginners mailing list archive at Nabble.com. > > > > > > _______________________________________________ > > Beginners mailing list > > [hidden email] > > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > > > > If you reply to this email, your message will be added to the discussion below: > > http://forum.world.st/Need-a-local-tutor-for-Squeak-tp4888503p4894649.html > > To start a new topic under Squeak - Beginners, email ml-node+s1294792n107673h12@n4.nabble.com > > To unsubscribe from Squeak - Beginners, click here. > > NAML > > > > > > -- > View this message in context: http://forum.world.st/Need-a-local-tutor-for-Squeak-tp4888503p4894650.html > Sent from the Squeak - Beginners mailing list archive at Nabble.com. > _______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners From joseph.alotta at gmail.com Mon May 16 14:45:46 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Mon May 16 15:21:37 2016 Subject: [Newbies] Re: Need a local tutor for Squeak In-Reply-To: <1463377175232-4895074.post@n4.nabble.com> References: <1459896336969-4888503.post@n4.nabble.com> <5794f5d6-67a8-a7ca-a02c-19668cec4fde@blackpagedigital.com> <36549ABE-76A4-4C3F-B104-170FA943B8A3@gmail.com> <088b01d1ad1f$b27ec960$177c5c20$@usmedrec.com> <9625F69E-9311-4D88-B013-6987032AD5EA@gmail.com> <089f01d1ad20$c982b440$5c881cc0$@usmedrec.com> <1463377175232-4895074.post@n4.nabble.com> Message-ID: It would be very hard to compete with meetup. They have a moat because they were first. I run a meetup group and I have 1000 members, just because they are on meetup and not somewhere else. Same thing for eBay. Everyone hates it. But it is where the buyers and the sellers are. Sincerely, Joe. > On May 16, 2016, at 12:39 AM, askoh [via Smalltalk] wrote: > > Ron: > > Have you thought about a virtual equivalent to meetup.com? Is there something available already? > > All the best, > Aik-Siong Koh > > If you reply to this email, your message will be added to the discussion below: > http://forum.world.st/Need-a-local-tutor-for-Squeak-tp4888503p4895074.html > To start a new topic under Squeak - Beginners, email ml-node+s1294792n107673h12@n4.nabble.com > To unsubscribe from Squeak - Beginners, click here. > NAML -- View this message in context: http://forum.world.st/Need-a-local-tutor-for-Squeak-tp4888503p4895149.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160516/c69b2fa1/attachment-0001.htm From kilon.alios at gmail.com Mon May 16 15:09:29 2016 From: kilon.alios at gmail.com (kilon.alios) Date: Mon May 16 15:45:21 2016 Subject: [Newbies] Re: Machine gun the Balloon! In-Reply-To: <20160507173824.GA67152@shell.msen.com> References: <20160507173824.GA67152@shell.msen.com> Message-ID: <1463411369044-4895155.post@n4.nabble.com> Dave that was a great post and I agree 100% One of the things Stef says is that "Pharo is yours" but of course that applies for all free software out there So if you want to take Pharo or Squeak to any direction you are more than welcomed and both communities are very friendly towards any kind of contribution. But in end we all use Squeak or Pharo or both because it's a ton of fun. -- View this message in context: http://forum.world.st/Machine-gun-the-Balloon-tp4893792p4895155.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. From ron at usmedrec.com Mon May 16 15:46:45 2016 From: ron at usmedrec.com (Ron Teitelbaum) Date: Mon May 16 15:46:44 2016 Subject: [Newbies] Re: Need a local tutor for Squeak In-Reply-To: References: <1459896336969-4888503.post@n4.nabble.com> <5794f5d6-67a8-a7ca-a02c-19668cec4fde@blackpagedigital.com> <36549ABE-76A4-4C3F-B104-170FA943B8A3@gmail.com> <088b01d1ad1f$b27ec960$177c5c20$@usmedrec.com> <9625F69E-9311-4D88-B013-6987032AD5EA@gmail.com> <089f01d1ad20$c982b440$5c881cc0$@usmedrec.com> <1463377175232-4895074.post@n4.nabble.com> Message-ID: <0fea01d1af8a$26a7e4e0$73f7aea0$@usmedrec.com> Odd that I never got Aik-Siong Koh email! Checked junk mail also but nothing. Did everyone else get it or am I missing something? Ahh maybe the email didn't go to beginners@list.squeakfoundation.org? I have been thinking about something along those lines, something where users could purchase a single license and then connect to various organizations, events and activities. This is the opposite of having an organizer pay. Either way it does seem like a good idea! Thanks for suggesting it. All the best, Ron Teitelbaum From: beginners-bounces@lists.squeakfoundation.org [mailto:beginners-bounces@lists.squeakfoundation.org] On Behalf Of Joseph Alotta Sent: Monday, May 16, 2016 10:46 AM To: beginners@lists.squeakfoundation.org Subject: [Newbies] Re: Need a local tutor for Squeak It would be very hard to compete with meetup. They have a moat because they were first. I run a meetup group and I have 1000 members, just because they are on meetup and not somewhere else. Same thing for eBay. Everyone hates it. But it is where the buyers and the sellers are. Sincerely, Joe. > On May 16, 2016, at 12:39 AM, askoh [via Smalltalk] <[hidden email]> wrote: > > Ron: > > Have you thought about a virtual equivalent to meetup.com? Is there something available already? > > All the best, > Aik-Siong Koh > > If you reply to this email, your message will be added to the discussion below: > http://forum.world.st/Need-a-local-tutor-for-Squeak-tp4888503p4895074.html > To start a new topic under Squeak - Beginners, email [hidden email] > To unsubscribe from Squeak - Beginners, click here. > NAML _____ View this message in context: Re: Need a local tutor for Squeak Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160516/75ffa5ca/attachment.htm From askoh at askoh.com Mon May 16 17:53:00 2016 From: askoh at askoh.com (askoh) Date: Mon May 16 18:28:52 2016 Subject: [Newbies] Re: Need a local tutor for Squeak In-Reply-To: References: <1459896336969-4888503.post@n4.nabble.com> <5794f5d6-67a8-a7ca-a02c-19668cec4fde@blackpagedigital.com> <36549ABE-76A4-4C3F-B104-170FA943B8A3@gmail.com> <088b01d1ad1f$b27ec960$177c5c20$@usmedrec.com> <9625F69E-9311-4D88-B013-6987032AD5EA@gmail.com> <089f01d1ad20$c982b440$5c881cc0$@usmedrec.com> <1463377175232-4895074.post@n4.nabble.com> Message-ID: <1463421180077-4895183.post@n4.nabble.com> In MeetUp, I go to a real place to meet real people. Great for popular activities. But I would like to meet Smalltalkers once a month or a week for realtime conversations. There are too few or no one nearby who are interested. A virtual meeting place would be a great substitute. Is there such a website or app? Perhaps, in the future we can combine physical with virtual meetings simultaneously. A remote user can see the real meeting room and identify the person he wants to talk to. He then calls that person to start a conversation. Does such a capability exist? All the best, Aik-Siong Koh -- View this message in context: http://forum.world.st/Need-a-local-tutor-for-Squeak-tp4888503p4895183.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. From ron at usmedrec.com Tue May 17 00:59:07 2016 From: ron at usmedrec.com (Ron Teitelbaum) Date: Tue May 17 00:59:05 2016 Subject: [Newbies] Re: Need a local tutor for Squeak In-Reply-To: <1463421180077-4895183.post@n4.nabble.com> References: <1459896336969-4888503.post@n4.nabble.com> <5794f5d6-67a8-a7ca-a02c-19668cec4fde@blackpagedigital.com> <36549ABE-76A4-4C3F-B104-170FA943B8A3@gmail.com> <088b01d1ad1f$b27ec960$177c5c20$@usmedrec.com> <9625F69E-9311-4D88-B013-6987032AD5EA@gmail.com> <089f01d1ad20$c982b440$5c881cc0$@usmedrec.com> <1463377175232-4895074.post@n4.nabble.com> <1463421180077-4895183.post@n4.nabble.com> Message-ID: <113801d1afd7$50eaf560$f2c0e020$@usmedrec.com> > -----Original Message----- > From: beginners-bounces@lists.squeakfoundation.org [mailto:beginners- > bounces@lists.squeakfoundation.org] On Behalf Of askoh > > In MeetUp, I go to a real place to meet real people. Great for popular > activities. > > But I would like to meet Smalltalkers once a month or a week for realtime > conversations. There are too few or no one nearby who are interested. A > virtual meeting place would be a great substitute. Is there such a website or > app? > > Perhaps, in the future we can combine physical with virtual meetings > simultaneously. A remote user can see the real meeting room and identify > the person he wants to talk to. He then calls that person to start a > conversation. Does such a capability exist? > [Ron Teitelbaum] Right now I think your options are Facebook or google hangouts. There is also second life which used to have a lot of areas dedicated for different activities like science and academia but it turned into a ghost town for most of the useful areas. I like the idea but need to really think it through. The real problem with 3d as I see it is that there is a certain amount of investment required of users to learn and understand the platform. The activity needs to pay back that investment with something useful. We do well in education, training, counseling, and collaboration. Places where the software provides sufficient benefits to the users to pay back that investment. MeetUp is a calendaring and coordination application. It has a very low cost to users to use and understand and a minimal cost to organizers, and a benefit that organizers can charge more than the cost to members that participate. I'm not sure that the same is true of a virtual world. We tried having google hangouts for Squeak people! That was fun, but difficult to coordinate. It also quickly dropped off in attendance after the first few meetings. If someone would like to use Terf for Squeak meetings, and we can organize something that would be useful to pay back participants, I would be very interested. Please feel free to contact me. Ron@3dicc.com. What I would suggest is an agenda, speakers, training, sprints, documentation days, programming contests, something like that. All the best, Ron Teitelbaum > All the best, > Aik-Siong Koh > > > > -- > View this message in context: http://forum.world.st/Need-a-local-tutor-for- > Squeak-tp4888503p4895183.html > Sent from the Squeak - Beginners mailing list archive at Nabble.com. > _______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners From joseph.alotta at gmail.com Tue May 17 17:06:50 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Tue May 17 17:06:54 2016 Subject: [Newbies] whats the difference between over and through Message-ID: Greetings, What?s the difference between over and through in the debugger? Is there something that goes to the next line of code? Sincerely, Joe. From bernhard at pieber.com Tue May 17 17:18:37 2016 From: bernhard at pieber.com (Bernhard Pieber) Date: Tue May 17 17:18:40 2016 Subject: [Newbies] whats the difference between over and through In-Reply-To: References: Message-ID: Hi, The difference is only relevant for statements with blocks. Over executes the next message send and then stops. Over does not enter block, though. Through does. Cheers, Bernhard > Am 17.05.2016 um 19:06 schrieb Joseph Alotta : > > Greetings, > > What?s the difference between over and through in the debugger? > > Is there something that goes to the next line of code? > > > Sincerely, > > Joe. > > > _______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners From ron at usmedrec.com Tue May 17 17:36:58 2016 From: ron at usmedrec.com (Ron Teitelbaum) Date: Tue May 17 17:36:56 2016 Subject: [Newbies] whats the difference between over and through In-Reply-To: References: Message-ID: <134601d1b062$b735e060$25a1a120$@usmedrec.com> Hi Joe, This is a very good question. It's something that if you been using the debugger for a long time comes naturally but when you are new it seems strange. Take this code for example: | lock | lock := Mutex new. lock critical: [Transcript show: 'I am here'] debug this code and play with the different options to see how this works. In general there are a number of times where what you want to debug is inside a block. Getting into that block can be a real pain. In many cases you really just want to say take me through this outer code and into that block so I can debug what is inside it. (in this case Transcript show: ) "Over" will skip it and "Into" will take you down the rabbit hole of code that surrounds it. In this case try debugging that code using the different options and see how much easier getting inside that block is when you use Through. I think the accepted description is: Through: if the debugger is going to execute a block, with this button you can step though this block. and it makes sense when you think I want to step through what is inside the block. "Take me through the inside of this block". Does that make sense? All the best, Ron Teitelbaum > -----Original Message----- > From: beginners-bounces@lists.squeakfoundation.org [mailto:beginners- > bounces@lists.squeakfoundation.org] On Behalf Of Joseph Alotta > Sent: Tuesday, May 17, 2016 1:07 PM > To: beginners@lists.squeakfoundation.org > Subject: [Newbies] whats the difference between over and through > > Greetings, > > What?s the difference between over and through in the debugger? > > Is there something that goes to the next line of code? > > > Sincerely, > > Joe. > > > _______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners From herbertkoenig at gmx.net Tue May 17 20:32:32 2016 From: herbertkoenig at gmx.net (=?UTF-8?Q?Herbert_K=c3=b6nig?=) Date: Tue May 17 20:32:44 2016 Subject: [Newbies] whats the difference between over and through In-Reply-To: <134601d1b062$b735e060$25a1a120$@usmedrec.com> References: <134601d1b062$b735e060$25a1a120$@usmedrec.com> Message-ID: <1e24f255-6f03-65ec-a078-7e75b50594dc@gmx.net> Hi Joe, a practical tip if you debug loops: myCollection collect: [:each| "You need 'through' to get into the loop" self doThis. "Through or over are ok here" self doThatWhichTakesLongToRun. "use over to go over this long running method" somethingElse doMore "here you need to press through again or you'll learn about the inner workings of collect :-))"] I want to mention three things: 1- if you are inside a loop with no other block inside you can always continue with pressing 'Through'. This will then go through the next iteration of the loop but step over the method sends inside the loop. Methods inside the loop seem to take much longer if you go over them via 'through' than if you go over them via 'over'. Especially on slow hardware. 2- if by accident you press 'over' while debugging the last send inside a loop you get to the outer context of your loop which is very confusing at the beginning. To get back into your loop you have to step 'into' the block you'll see there. 3- if you've seen enough after being 'through' three iterations of of a 1000 iteration loop you continue one level above (top pane of the debugger) and debug 'over' that loop. Most important : experiment. I have no Squeak at hand so take the above just as a coarse description on what you may encounter on your debugging journey. I usually debug my code into life and I still manage to press the wrong buttons while debugging :-)) Cheers, Herbert Am 17.05.2016 um 19:36 schrieb Ron Teitelbaum: > Hi Joe, > > This is a very good question. It's something that if you been using the debugger for a long time comes naturally but when you are new it seems strange. > > Take this code for example: > > | lock | > lock := Mutex new. > lock critical: [Transcript show: 'I am here'] > > debug this code and play with the different options to see how this works. In general there are a number of times where what you want to debug is inside a block. Getting into that block can be a real pain. In many cases you really just want to say take me through this outer code and into that block so I can debug what is inside it. (in this case Transcript show: ) > > "Over" will skip it and "Into" will take you down the rabbit hole of code that surrounds it. > > In this case try debugging that code using the different options and see how much easier getting inside that block is when you use Through. > > I think the accepted description is: > Through: if the debugger is going to execute a block, with this button you can step though this block. > > and it makes sense when you think I want to step through what is inside the block. "Take me through the inside of this block". > > Does that make sense? > > All the best, > > Ron Teitelbaum > >> -----Original Message----- >> From: beginners-bounces@lists.squeakfoundation.org [mailto:beginners- >> bounces@lists.squeakfoundation.org] On Behalf Of Joseph Alotta >> Sent: Tuesday, May 17, 2016 1:07 PM >> To: beginners@lists.squeakfoundation.org >> Subject: [Newbies] whats the difference between over and through >> >> Greetings, >> >> What?s the difference between over and through in the debugger? >> >> Is there something that goes to the next line of code? >> >> >> Sincerely, >> >> Joe. >> >> >> _______________________________________________ >> 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 From ron at usmedrec.com Tue May 17 21:06:41 2016 From: ron at usmedrec.com (Ron Teitelbaum) Date: Tue May 17 21:06:38 2016 Subject: [Newbies] whats the difference between over and through In-Reply-To: <1e24f255-6f03-65ec-a078-7e75b50594dc@gmx.net> References: <134601d1b062$b735e060$25a1a120$@usmedrec.com> <1e24f255-6f03-65ec-a078-7e75b50594dc@gmx.net> Message-ID: <143d01d1b080$032f50b0$098df210$@usmedrec.com> Nice description Herbert! That reminded me of one extra thing. It's kind of hidden but very useful. If you need to get out of a loop but don't want to restart and add a halt, you can click on some place in your code then select "Run To Here" from the pop up menu (right click on windows). That will continue your code until it gets to where the cursor is currently located and resume debugging from that location. That's pretty useful too. All the best, Ron > From: Herbert K?nig > Sent: Tuesday, May 17, 2016 4:33 PM > > Hi Joe, > > a practical tip if you debug loops: > > myCollection collect: [:each| "You need 'through' to get into the loop" > > self doThis. "Through or over are ok here" > > self doThatWhichTakesLongToRun. "use over to go over this long running > method" > > somethingElse doMore "here you need to press through again or you'll > learn about the inner workings of collect :-))"] > > I want to mention three things: > > 1- if you are inside a loop with no other block inside you can always > continue with pressing 'Through'. This will then go through the next iteration > of the loop but step over the method sends inside the loop. > Methods inside the loop seem to take much longer if you go over them via > 'through' than if you go over them via 'over'. Especially on slow hardware. > > 2- if by accident you press 'over' while debugging the last send inside a loop > you get to the outer context of your loop which is very confusing at the > beginning. To get back into your loop you have to step 'into' the block you'll > see there. > > 3- if you've seen enough after being 'through' three iterations of of a > 1000 iteration loop you continue one level above (top pane of the > debugger) and debug 'over' that loop. > > Most important : experiment. > > I have no Squeak at hand so take the above just as a coarse description on > what you may encounter on your debugging journey. > > I usually debug my code into life and I still manage to press the wrong > buttons while debugging :-)) > > > Cheers, > > > Herbert > > Am 17.05.2016 um 19:36 schrieb Ron Teitelbaum: > > Hi Joe, > > > > This is a very good question. It's something that if you been using the > debugger for a long time comes naturally but when you are new it seems > strange. > > > > Take this code for example: > > > > | lock | > > lock := Mutex new. > > lock critical: [Transcript show: 'I am here'] > > > > debug this code and play with the different options to see how this works. > In general there are a number of times where what you want to debug is > inside a block. Getting into that block can be a real pain. In many cases you > really just want to say take me through this outer code and into that block > so I can debug what is inside it. (in this case Transcript show: ) > > > > "Over" will skip it and "Into" will take you down the rabbit hole of code > that surrounds it. > > > > In this case try debugging that code using the different options and see > how much easier getting inside that block is when you use Through. > > > > I think the accepted description is: > > Through: if the debugger is going to execute a block, with this button you > can step though this block. > > > > and it makes sense when you think I want to step through what is inside > the block. "Take me through the inside of this block". > > > > Does that make sense? > > > > All the best, > > > > Ron Teitelbaum > > > >> -----Original Message----- > >> From: beginners-bounces@lists.squeakfoundation.org [mailto:beginners- > >> bounces@lists.squeakfoundation.org] On Behalf Of Joseph Alotta > >> Sent: Tuesday, May 17, 2016 1:07 PM > >> To: beginners@lists.squeakfoundation.org > >> Subject: [Newbies] whats the difference between over and through > >> > >> Greetings, > >> > >> What?s the difference between over and through in the debugger? > >> > >> Is there something that goes to the next line of code? > >> > >> > >> Sincerely, > >> > >> Joe. > >> > >> > >> _______________________________________________ > >> 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 From joseph.alotta at gmail.com Wed May 18 13:48:19 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Wed May 18 14:24:25 2016 Subject: [Newbies] Re: whats the difference between over and through In-Reply-To: <143d01d1b080$032f50b0$098df210$@usmedrec.com> References: <134601d1b062$b735e060$25a1a120$@usmedrec.com> <1e24f255-6f03-65ec-a078-7e75b50594dc@gmx.net> <143d01d1b080$032f50b0$098df210$@usmedrec.com> Message-ID: Thanks for all the help. Thanks for the sample code also. My debugging is improving. > On May 17, 2016, at 3:30 PM, Ron Teitelbaum [via Smalltalk] wrote: > > Nice description Herbert! That reminded me of one extra thing. It's kind of hidden but very useful. > > If you need to get out of a loop but don't want to restart and add a halt, you can click on some place in your code then select "Run To Here" from the pop up menu (right click on windows). > > That will continue your code until it gets to where the cursor is currently located and resume debugging from that location. > > That's pretty useful too. > > All the best, > > Ron > > > From: Herbert K?nig > > Sent: Tuesday, May 17, 2016 4:33 PM > > > > Hi Joe, > > > > a practical tip if you debug loops: > > > > myCollection collect: [:each| "You need 'through' to get into the loop" > > > > self doThis. "Through or over are ok here" > > > > self doThatWhichTakesLongToRun. "use over to go over this long running > > method" > > > > somethingElse doMore "here you need to press through again or you'll > > learn about the inner workings of collect :-))"] > > > > I want to mention three things: > > > > 1- if you are inside a loop with no other block inside you can always > > continue with pressing 'Through'. This will then go through the next iteration > > of the loop but step over the method sends inside the loop. > > Methods inside the loop seem to take much longer if you go over them via > > 'through' than if you go over them via 'over'. Especially on slow hardware. > > > > 2- if by accident you press 'over' while debugging the last send inside a loop > > you get to the outer context of your loop which is very confusing at the > > beginning. To get back into your loop you have to step 'into' the block you'll > > see there. > > > > 3- if you've seen enough after being 'through' three iterations of of a > > 1000 iteration loop you continue one level above (top pane of the > > debugger) and debug 'over' that loop. > > > > Most important : experiment. > > > > I have no Squeak at hand so take the above just as a coarse description on > > what you may encounter on your debugging journey. > > > > I usually debug my code into life and I still manage to press the wrong > > buttons while debugging :-)) > > > > > > Cheers, > > > > > > Herbert > > > > Am 17.05.2016 um 19:36 schrieb Ron Teitelbaum: > > > Hi Joe, > > > > > > This is a very good question. It's something that if you been using the > > debugger for a long time comes naturally but when you are new it seems > > strange. > > > > > > Take this code for example: > > > > > > | lock | > > > lock := Mutex new. > > > lock critical: [Transcript show: 'I am here'] > > > > > > debug this code and play with the different options to see how this works. > > In general there are a number of times where what you want to debug is > > inside a block. Getting into that block can be a real pain. In many cases you > > really just want to say take me through this outer code and into that block > > so I can debug what is inside it. (in this case Transcript show: ) > > > > > > "Over" will skip it and "Into" will take you down the rabbit hole of code > > that surrounds it. > > > > > > In this case try debugging that code using the different options and see > > how much easier getting inside that block is when you use Through. > > > > > > I think the accepted description is: > > > Through: if the debugger is going to execute a block, with this button you > > can step though this block. > > > > > > and it makes sense when you think I want to step through what is inside > > the block. "Take me through the inside of this block". > > > > > > Does that make sense? > > > > > > All the best, > > > > > > Ron Teitelbaum > > > > > >> -----Original Message----- > > >> From: [hidden email] [mailto:beginners- > > >> [hidden email]] On Behalf Of Joseph Alotta > > >> Sent: Tuesday, May 17, 2016 1:07 PM > > >> To: [hidden email] > > >> Subject: [Newbies] whats the difference between over and through > > >> > > >> Greetings, > > >> > > >> What?s the difference between over and through in the debugger? > > >> > > >> Is there something that goes to the next line of code? > > >> > > >> > > >> Sincerely, > > >> > > >> Joe. > > >> > > >> > > >> _______________________________________________ > > >> Beginners mailing list > > >> [hidden email] > > >> http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > _______________________________________________ > > > Beginners mailing list > > > [hidden email] > > > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > > _______________________________________________ > > Beginners mailing list > > [hidden email] > > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > _______________________________________________ > Beginners mailing list > [hidden email] > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > If you reply to this email, your message will be added to the discussion below: > http://forum.world.st/whats-the-difference-between-over-and-through-tp4895443p4895522.html > To start a new topic under Squeak - Beginners, email ml-node+s1294792n107673h12@n4.nabble.com > To unsubscribe from Squeak - Beginners, click here. > NAML -- View this message in context: http://forum.world.st/whats-the-difference-between-over-and-through-tp4895443p4895740.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160518/c46081d7/attachment-0001.htm From joseph.alotta at gmail.com Thu May 19 20:43:03 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Thu May 19 20:43:09 2016 Subject: [Newbies] help with morphic Message-ID: <37BDE9EE-7377-480B-838B-EC54C138CEE8@gmail.com> Greetings, I am having trouble getting started with Morphic. I tried the tutorial on squeak.org and found it too hard to follow. Now I have morphs on my screen and I don?t know how to close them. I looked for videos on Morphic and found only a technical comparison of changes. Is there a video designed for beginners that someone not an egghead can follow? Sincerely, Joe. From btc at openinworld.com Thu May 19 23:38:59 2016 From: btc at openinworld.com (Ben Coman) Date: Thu May 19 23:39:21 2016 Subject: [Newbies] help with morphic In-Reply-To: <37BDE9EE-7377-480B-838B-EC54C138CEE8@gmail.com> References: <37BDE9EE-7377-480B-838B-EC54C138CEE8@gmail.com> Message-ID: On Fri, May 20, 2016 at 4:43 AM, Joseph Alotta wrote: > Greetings, > > I am having trouble getting started with Morphic. I tried the tutorial on squeak.org and found it too hard to follow. Now I have morphs on my screen and I don?t know how to close them. > > I looked for videos on Morphic and found only a technical comparison of changes. Is there a video designed for beginners that someone not an egghead can follow? I think Steve Wessels LaserGame is a great general tutorial, which also covers Morphic. http://squeak.preeminent.org/tut2007/html/ From btc at openinworld.com Thu May 19 23:41:11 2016 From: btc at openinworld.com (Ben Coman) Date: Thu May 19 23:41:34 2016 Subject: [Newbies] help with morphic In-Reply-To: References: <37BDE9EE-7377-480B-838B-EC54C138CEE8@gmail.com> Message-ID: On Fri, May 20, 2016 at 7:38 AM, Ben Coman wrote: > On Fri, May 20, 2016 at 4:43 AM, Joseph Alotta wrote: >> Greetings, >> >> I am having trouble getting started with Morphic. I tried the tutorial on squeak.org and found it too hard to follow. Now I have morphs on my screen and I don?t know how to close them. >> >> I looked for videos on Morphic and found only a technical comparison of changes. Is there a video designed for beginners that someone not an egghead can follow? > > I think Steve Wessels LaserGame is a great general tutorial, which > also covers Morphic. > http://squeak.preeminent.org/tut2007/html/ (Sorry, darn keyboard shortcut sent that before I'd finished. ) Best to regress to Squeak 3.9 while doing the tutorial, then if you like, upgrade your game to current version. cheers -ben From stephan at stack.nl Fri May 20 06:57:36 2016 From: stephan at stack.nl (Stephan Eggermont) Date: Fri May 20 06:57:45 2016 Subject: [Newbies] Re: help with morphic In-Reply-To: <37BDE9EE-7377-480B-838B-EC54C138CEE8@gmail.com> References: <37BDE9EE-7377-480B-838B-EC54C138CEE8@gmail.com> Message-ID: <1e351e97-9411-c811-a4d9-fa21d4b3500b@stack.nl> On 19/05/16 22:43, Joseph Alotta wrote: > Greetings, > > I am having trouble getting started with Morphic. I tried the tutorial on squeak.org and found it too hard to follow. Now I have morphs on my screen and I don?t know how to close them. > > I looked for videos on Morphic and found only a technical comparison of changes. Is there a video designed for beginners that someone not an egghead can follow? I have produced some material on Morphic with Pharo. There are of course small differences with Squeak, but most of it should translate well. If you tell me where it gets confusing, I can explain better and fix. https://github.com/StephanEggermont/MorphicDraw https://vimeo.com/130781061 Stephan From bert at freudenbergs.de Fri May 20 08:35:51 2016 From: bert at freudenbergs.de (Bert Freudenberg) Date: Fri May 20 08:35:53 2016 Subject: [Newbies] help with morphic In-Reply-To: <37BDE9EE-7377-480B-838B-EC54C138CEE8@gmail.com> References: <37BDE9EE-7377-480B-838B-EC54C138CEE8@gmail.com> Message-ID: <24BE4FC7-C0A3-4EAB-81DC-4CBE73563129@freudenbergs.de> > On 19.05.2016, at 22:43, Joseph Alotta wrote: > > Greetings, > > I am having trouble getting started with Morphic. I tried the tutorial on squeak.org and found it too hard to follow. Now I have morphs on my screen and I don?t know how to close them. > > I looked for videos on Morphic and found only a technical comparison of changes. Is there a video designed for beginners that someone not an egghead can follow? Lawson English produced a series of tutorial videos. He covers Morphic starting at #18: https://www.youtube.com/playlist?list=PL6601A198DF14788D - Bert - -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4207 bytes Desc: not available Url : http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160520/88b6337c/smime.bin From bert at freudenbergs.de Fri May 20 08:37:10 2016 From: bert at freudenbergs.de (Bert Freudenberg) Date: Fri May 20 08:37:13 2016 Subject: [Newbies] help with morphic In-Reply-To: <24BE4FC7-C0A3-4EAB-81DC-4CBE73563129@freudenbergs.de> References: <37BDE9EE-7377-480B-838B-EC54C138CEE8@gmail.com> <24BE4FC7-C0A3-4EAB-81DC-4CBE73563129@freudenbergs.de> Message-ID: <1DDA94BF-A5F8-4D8F-8699-4341233776FD@freudenbergs.de> > On 20.05.2016, at 10:35, Bert Freudenberg wrote: > > >> On 19.05.2016, at 22:43, Joseph Alotta wrote: >> >> Greetings, >> >> I am having trouble getting started with Morphic. I tried the tutorial on squeak.org and found it too hard to follow. Now I have morphs on my screen and I don?t know how to close them. >> >> I looked for videos on Morphic and found only a technical comparison of changes. Is there a video designed for beginners that someone not an egghead can follow? > > Lawson English produced a series of tutorial videos. He covers Morphic starting at #18: > > https://www.youtube.com/playlist?list=PL6601A198DF14788D Btw, this and others are linked from: http://squeak.org/documentation/ but maybe that?s not visible enough? - Bert - -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4207 bytes Desc: not available Url : http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160520/0040e510/smime-0001.bin From joseph.alotta at gmail.com Mon May 23 15:25:45 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Mon May 23 15:25:51 2016 Subject: [Newbies] size of character Message-ID: <91CF009E-B290-4227-9EC0-8B32DEFA7016@gmail.com> ?j? size ==> 1 $j size ==> error. Why shouldn?t the size of a character be 1? Sincerely, Joe. From bert at freudenbergs.de Mon May 23 15:29:13 2016 From: bert at freudenbergs.de (Bert Freudenberg) Date: Mon May 23 15:29:17 2016 Subject: [Newbies] size of character In-Reply-To: <91CF009E-B290-4227-9EC0-8B32DEFA7016@gmail.com> References: <91CF009E-B290-4227-9EC0-8B32DEFA7016@gmail.com> Message-ID: <0DB0C736-2861-46CD-B3CF-A96B9283B37A@freudenbergs.de> On 23.05.2016, at 17:25, Joseph Alotta wrote: > > ?j? size ==> 1 > > $j size ==> error. > > Why shouldn?t the size of a character be 1? Because it?s not a collection: #size is part of the collection protocol, but it doesn?t make sense to send #at: to a character. - Bert - -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4207 bytes Desc: not available Url : http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160523/d0473ec8/smime.bin From joseph.alotta at gmail.com Mon May 23 15:12:18 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Mon May 23 15:49:00 2016 Subject: [Newbies] Re: size of character In-Reply-To: <0DB0C736-2861-46CD-B3CF-A96B9283B37A@freudenbergs.de> References: <91CF009E-B290-4227-9EC0-8B32DEFA7016@gmail.com> <0DB0C736-2861-46CD-B3CF-A96B9283B37A@freudenbergs.de> Message-ID: <492EA656-2C31-49A2-86B0-DD3DF1294C8E@gmail.com> I see. Thank you. > On May 23, 2016, at 9:52 AM, Bert Freudenberg [via Smalltalk] wrote: > > On 23.05.2016, at 17:25, Joseph Alotta <[hidden email]> wrote: > > > > ?j? size ==> 1 > > > > $j size ==> error. > > > > Why shouldn?t the size of a character be 1? > > Because it?s not a collection: #size is part of the collection protocol, but it doesn?t make sense to send #at: to a character. > > - Bert - > > > > > _______________________________________________ > Beginners mailing list > [hidden email] > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > smime.p7s (5K) Download Attachment > > > If you reply to this email, your message will be added to the discussion below: > http://forum.world.st/size-of-character-tp4896851p4896855.html > To start a new topic under Squeak - Beginners, email ml-node+s1294792n107673h12@n4.nabble.com > To unsubscribe from Squeak - Beginners, click here. > NAML -- View this message in context: http://forum.world.st/size-of-character-tp4896851p4896857.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160523/489e42b0/attachment.htm From joseph.alotta at gmail.com Wed May 25 19:22:00 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Wed May 25 19:37:50 2016 Subject: [Newbies] FileDirectory Message-ID: <709657E1-8F3D-42FB-94ED-EE0F9731DD3F@gmail.com> Greetings, I am looking for some documentation or snippets of code for using the FileDirectory class. I want to check if a file exists before I try to read it. I also want to look at a list of files in the directory. I did search SBE and google but found nothing. Sincerely, Joe. From ron at usmedrec.com Wed May 25 20:19:48 2016 From: ron at usmedrec.com (Ron Teitelbaum) Date: Wed May 25 20:19:54 2016 Subject: [Newbies] FileDirectory In-Reply-To: <709657E1-8F3D-42FB-94ED-EE0F9731DD3F@gmail.com> References: <709657E1-8F3D-42FB-94ED-EE0F9731DD3F@gmail.com> Message-ID: <00c301d1b6c2$c9ae77a0$5d0b66e0$@usmedrec.com> Hi Joe, The hardest part of FileDirectory is understanding default. So start with: FileDirectory default. Note that default is on the class side. Once you inspect that you are now on the instance side. Have a look at the categories #enumeration, #'file status', and #'file operations', and #'file name utilities' when you get a file from that instance you are no longer on FileDirectory. What class are the file entries? Let me know if that helps. All the best, Ron Teitelbaum > -----Original Message----- > From: beginners-bounces@lists.squeakfoundation.org [mailto:beginners- > bounces@lists.squeakfoundation.org] On Behalf Of Joseph Alotta > Sent: Wednesday, May 25, 2016 3:22 PM > To: beginners@lists.squeakfoundation.org > Subject: [Newbies] FileDirectory > > Greetings, > > I am looking for some documentation or snippets of code for using the > FileDirectory class. > > I want to check if a file exists before I try to read it. > > I also want to look at a list of files in the directory. > > I did search SBE and google but found nothing. > > Sincerely, > > Joe. > > > > _______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners From joseph.alotta at gmail.com Wed May 25 20:14:32 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Wed May 25 20:51:30 2016 Subject: [Newbies] Re: FileDirectory In-Reply-To: <00c301d1b6c2$c9ae77a0$5d0b66e0$@usmedrec.com> References: <709657E1-8F3D-42FB-94ED-EE0F9731DD3F@gmail.com> <00c301d1b6c2$c9ae77a0$5d0b66e0$@usmedrec.com> Message-ID: <2C3FF578-C458-4C13-AA34-2A6B133B3B85@gmail.com> Hi Ron, I get an instance of UnixFileDirectory. And there are only 6 methods for UnixFileDirectory, none of them doing what I want. Sincerely, Joe. > On May 25, 2016, at 2:43 PM, Ron Teitelbaum [via Smalltalk] wrote: > > Hi Joe, > > The hardest part of FileDirectory is understanding default. > > So start with: FileDirectory default. > > Note that default is on the class side. Once you inspect that you are now > on the instance side. Have a look at the categories #enumeration, #'file > status', and #'file operations', and #'file name utilities' > > when you get a file from that instance you are no longer on FileDirectory. > What class are the file entries? > > Let me know if that helps. > > All the best, > > Ron Teitelbaum > > > > > -----Original Message----- > > From: [hidden email] [mailto:beginners- > > [hidden email]] On Behalf Of Joseph Alotta > > Sent: Wednesday, May 25, 2016 3:22 PM > > To: [hidden email] > > Subject: [Newbies] FileDirectory > > > > Greetings, > > > > I am looking for some documentation or snippets of code for using the > > FileDirectory class. > > > > I want to check if a file exists before I try to read it. > > > > I also want to look at a list of files in the directory. > > > > I did search SBE and google but found nothing. > > > > Sincerely, > > > > Joe. > > > > > > > > _______________________________________________ > > Beginners mailing list > > [hidden email] > > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > _______________________________________________ > Beginners mailing list > [hidden email] > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > If you reply to this email, your message will be added to the discussion below: > http://forum.world.st/FileDirectory-tp4897377p4897389.html > To start a new topic under Squeak - Beginners, email ml-node+s1294792n107673h12@n4.nabble.com > To unsubscribe from Squeak - Beginners, click here. > NAML -- View this message in context: http://forum.world.st/FileDirectory-tp4897377p4897398.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160525/3d67c634/attachment-0001.htm From hannes.hirzel at gmail.com Wed May 25 21:14:48 2016 From: hannes.hirzel at gmail.com (H. Hirzel) Date: Wed May 25 21:14:49 2016 Subject: [Newbies] Re: FileDirectory In-Reply-To: <2C3FF578-C458-4C13-AA34-2A6B133B3B85@gmail.com> References: <709657E1-8F3D-42FB-94ED-EE0F9731DD3F@gmail.com> <00c301d1b6c2$c9ae77a0$5d0b66e0$@usmedrec.com> <2C3FF578-C458-4C13-AA34-2A6B133B3B85@gmail.com> Message-ID: Have a look as well at http://wiki.squeak.org/squeak/2184 What exactly do you want to do? --Hannes On 5/25/16, Joseph Alotta wrote: > Hi Ron, > > I get an instance of UnixFileDirectory. And there are only 6 methods for > UnixFileDirectory, none of them doing what I want. > > Sincerely, > > Joe. > > > > >> On May 25, 2016, at 2:43 PM, Ron Teitelbaum [via Smalltalk] >> wrote: >> >> Hi Joe, >> >> The hardest part of FileDirectory is understanding default. >> >> So start with: FileDirectory default. >> >> Note that default is on the class side. Once you inspect that you are now >> >> on the instance side. Have a look at the categories #enumeration, #'file >> >> status', and #'file operations', and #'file name utilities' >> >> when you get a file from that instance you are no longer on FileDirectory. >> >> What class are the file entries? >> >> Let me know if that helps. >> >> All the best, >> >> Ron Teitelbaum >> >> >> >> > -----Original Message----- >> > From: [hidden email] [mailto:beginners- >> > [hidden email]] On Behalf Of Joseph Alotta >> > Sent: Wednesday, May 25, 2016 3:22 PM >> > To: [hidden email] >> > Subject: [Newbies] FileDirectory >> > >> > Greetings, >> > >> > I am looking for some documentation or snippets of code for using the >> > FileDirectory class. >> > >> > I want to check if a file exists before I try to read it. >> > >> > I also want to look at a list of files in the directory. >> > >> > I did search SBE and google but found nothing. >> > >> > Sincerely, >> > >> > Joe. >> > >> > >> > >> > _______________________________________________ >> > Beginners mailing list >> > [hidden email] >> > http://lists.squeakfoundation.org/mailman/listinfo/beginners >> >> _______________________________________________ >> Beginners mailing list >> [hidden email] >> http://lists.squeakfoundation.org/mailman/listinfo/beginners >> >> >> If you reply to this email, your message will be added to the discussion >> below: >> http://forum.world.st/FileDirectory-tp4897377p4897389.html >> To start a new topic under Squeak - Beginners, email >> ml-node+s1294792n107673h12@n4.nabble.com >> To unsubscribe from Squeak - Beginners, click here. >> NAML > > > > > > -- > View this message in context: > http://forum.world.st/FileDirectory-tp4897377p4897398.html > Sent from the Squeak - Beginners mailing list archive at Nabble.com. From ron at usmedrec.com Wed May 25 23:20:16 2016 From: ron at usmedrec.com (Ron Teitelbaum) Date: Wed May 25 23:20:22 2016 Subject: [Newbies] Re: FileDirectory In-Reply-To: <2C3FF578-C458-4C13-AA34-2A6B133B3B85@gmail.com> References: <709657E1-8F3D-42FB-94ED-EE0F9731DD3F@gmail.com> <00c301d1b6c2$c9ae77a0$5d0b66e0$@usmedrec.com> <2C3FF578-C458-4C13-AA34-2A6B133B3B85@gmail.com> Message-ID: <012d01d1b6db$ff9c9540$fed5bfc0$@usmedrec.com> Hi Joe, Excellent. Remember that you should also look at the super classes for methods. UnixFileDirectory is the instance of "FileDirectory default" but it's also a subclass of FileDirectory so the methods you can call include UnixFileDirectory and all the methods on the class hierarchy including the methods on FileDirectory. Please see the method categories on FileDirectory that I mentioned. The question I asked was a bit different. When you ask for the #entries of the instance "FileDirectory default" what class is each file? By the way, based on the question you asked there is a method on FileDirectory to determine if the file exists before you read it (it's in the method categories I pointed out to you). What is that method? All the best, Ron Teitelbaum From: beginners-bounces@lists.squeakfoundation.org [mailto:beginners-bounces@lists.squeakfoundation.org] On Behalf Of Joseph Alotta Sent: Wednesday, May 25, 2016 4:15 PM To: beginners@lists.squeakfoundation.org Subject: [Newbies] Re: FileDirectory Hi Ron, I get an instance of UnixFileDirectory. And there are only 6 methods for UnixFileDirectory, none of them doing what I want. Sincerely, Joe. > On May 25, 2016, at 2:43 PM, Ron Teitelbaum [via Smalltalk] <[hidden email]> wrote: > > Hi Joe, > > The hardest part of FileDirectory is understanding default. > > So start with: FileDirectory default. > > Note that default is on the class side. Once you inspect that you are now > on the instance side. Have a look at the categories #enumeration, #'file > status', and #'file operations', and #'file name utilities' > > when you get a file from that instance you are no longer on FileDirectory. > What class are the file entries? > > Let me know if that helps. > > All the best, > > Ron Teitelbaum > > > > > -----Original Message----- > > From: [hidden email] [mailto:beginners- > > [hidden email]] On Behalf Of Joseph Alotta > > Sent: Wednesday, May 25, 2016 3:22 PM > > To: [hidden email] > > Subject: [Newbies] FileDirectory > > > > Greetings, > > > > I am looking for some documentation or snippets of code for using the > > FileDirectory class. > > > > I want to check if a file exists before I try to read it. > > > > I also want to look at a list of files in the directory. > > > > I did search SBE and google but found nothing. > > > > Sincerely, > > > > Joe. > > > > > > > > _______________________________________________ > > Beginners mailing list > > [hidden email] > > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > _______________________________________________ > Beginners mailing list > [hidden email] > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > If you reply to this email, your message will be added to the discussion below: > http://forum.world.st/FileDirectory-tp4897377p4897389.html > To start a new topic under Squeak - Beginners, email [hidden email] > To unsubscribe from Squeak - Beginners, click here. > NAML _____ View this message in context: Re: FileDirectory Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160525/09840fc7/attachment.htm From joseph.alotta at gmail.com Wed May 25 23:23:39 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Thu May 26 00:00:36 2016 Subject: [Newbies] Re: FileDirectory In-Reply-To: References: <709657E1-8F3D-42FB-94ED-EE0F9731DD3F@gmail.com> <00c301d1b6c2$c9ae77a0$5d0b66e0$@usmedrec.com> <2C3FF578-C458-4C13-AA34-2A6B133B3B85@gmail.com> Message-ID: <05728D04-30E0-4717-9D6C-7941DD7D1159@gmail.com> > On May 25, 2016, at 3:38 PM, Hannes Hirzel [via Smalltalk] wrote: > > Have a look as well at http://wiki.squeak.org/squeak/2184 > > What exactly do you want to do? > > ?Hannes I saw that. It comes up first on google. It is 100% accurate and 100% useless. That is why the Terse Guide is the most popular documentation. As far as it goes. Sincerely, Joe. -- View this message in context: http://forum.world.st/FileDirectory-tp4897377p4897416.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160525/acb455a9/attachment.htm From joseph.alotta at gmail.com Wed May 25 23:46:51 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Thu May 26 00:23:49 2016 Subject: [Newbies] Re: FileDirectory In-Reply-To: <012d01d1b6db$ff9c9540$fed5bfc0$@usmedrec.com> References: <709657E1-8F3D-42FB-94ED-EE0F9731DD3F@gmail.com> <00c301d1b6c2$c9ae77a0$5d0b66e0$@usmedrec.com> <2C3FF578-C458-4C13-AA34-2A6B133B3B85@gmail.com> <012d01d1b6db$ff9c9540$fed5bfc0$@usmedrec.com> Message-ID: <060F5149-A086-4E1E-87AE-562EDF7BF3D8@gmail.com> Hi Ron, > Excellent. Remember that you should also look at the super classes for methods. UnixFileDirectory is the instance of ?FileDirectory default? but it?s also a subclass of FileDirectory so the methods you can call include UnixFileDirectory and all the methods on the class hierarchy including the methods on FileDirectory. Please see the method categories on FileDirectory that I mentioned. Okay, thanks. I tried to do something with that, but I got an error. I think I was trying to use a class method on the instance. > The question I asked was a bit different. When you ask for the #entries of the instance ?FileDirectory default? what class is each file? It is an Array of DirectoryEntry objects. > By the way, based on the question you asked there is a method on FileDirectory to determine if the file exists before you read it (it?s in the method categories I pointed out to you). What is that method? fileExists: I see what is happening. I thought the on: method changes the path, like cding a directory. But it gives a new instance. dir := FileDirectory default. dir on: '/Users/jja/Desktop? ==> UnixFileDirectory on '/Users/jja/Desktop' dir fileExists: 'categories.CSV? ==>false dir pathName ==>'/Users/jja/Desktop/Squeak-4.3-All-in-One.app/Contents/Resources' dir := FileDirectory on: '/Users/jja/Desktop? ==> UnixFileDirectory on '/Users/jja/Desktop' dir pathName ==> '/Users/jja/Desktop' dir fileExists: 'categories.CSV? ==> true So on: is the equivalent of new, in that it gives a new instance. Thank you, Sincerely, Joe. -- View this message in context: http://forum.world.st/FileDirectory-tp4897377p4897418.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160525/43db127d/attachment-0001.htm From ron at usmedrec.com Thu May 26 14:05:53 2016 From: ron at usmedrec.com (Ron Teitelbaum) Date: Thu May 26 14:05:56 2016 Subject: [Newbies] Re: FileDirectory In-Reply-To: <060F5149-A086-4E1E-87AE-562EDF7BF3D8@gmail.com> References: <709657E1-8F3D-42FB-94ED-EE0F9731DD3F@gmail.com> <00c301d1b6c2$c9ae77a0$5d0b66e0$@usmedrec.com> <2C3FF578-C458-4C13-AA34-2A6B133B3B85@gmail.com> <012d01d1b6db$ff9c9540$fed5bfc0$@usmedrec.com> <060F5149-A086-4E1E-87AE-562EDF7BF3D8@gmail.com> Message-ID: <02e601d1b757$b7817f10$26847d30$@usmedrec.com> From: beginners-bounces@lists.squeakfoundation.org [mailto:beginners-bounces@lists.squeakfoundation.org] On Behalf Of Joseph Alotta Sent: Wednesday, May 25, 2016 7:47 PM To: beginners@lists.squeakfoundation.org Subject: [Newbies] Re: FileDirectory Hi Ron, > Excellent. Remember that you should also look at the super classes for methods. UnixFileDirectory is the instance of ?FileDirectory default? but it?s also a subclass of FileDirectory so the methods you can call include UnixFileDirectory and all the methods on the class hierarchy including the methods on FileDirectory. Please see the method categories on FileDirectory that I mentioned. Okay, thanks. I tried to do something with that, but I got an error. I think I was trying to use a class method on the instance. > The question I asked was a bit different. When you ask for the #entries of the instance ?FileDirectory default? what class is each file? It is an Array of DirectoryEntry objects. > By the way, based on the question you asked there is a method on FileDirectory to determine if the file exists before you read it (it?s in the method categories I pointed out to you). What is that method? fileExists: I see what is happening. I thought the on: method changes the path, like cding a directory. But it gives a new instance. dir := FileDirectory default. dir on: '/Users/jja/Desktop? ==> UnixFileDirectory on '/Users/jja/Desktop' dir fileExists: 'categories.CSV? ==>false dir pathName ==>'/Users/jja/Desktop/Squeak-4.3-All-in-One.app/Contents/Resources' dir := FileDirectory on: '/Users/jja/Desktop? ==> UnixFileDirectory on '/Users/jja/Desktop' dir pathName ==> '/Users/jja/Desktop' dir fileExists: 'categories.CSV? ==> true So on: is the equivalent of new, in that it gives a new instance. [Ron Teitelbaum] Exactly right. Notice the on: method on the class side, then look at #on: on the instance side. This is one of those ?ah ha? moments. Classes create instances so when you see something like: ?Class on:? you should automatically notice that the method is being sent to the class side since you are sending the message to the class directly. This can get confusing if there is a method that results in something like myClass := Class, or when a method calls ?self class on:?. But again when it?s done the variable holds the class itself and you are still sending messages to a class when you use ?myClass on:?. So when you are talking directly to a class the method is on the class side. Class side method (unless they are like the method above returning a class) usually return instances of the class, so method are now instance side methods. Returning instances is one of the main uses of class side methods. Lookup factory methods, abstract factory, and prototype, for a good example of software patterns that creates instances from the class side. Understanding polymorphism is now very important since all methods on the hierarchy are callable (on both the class and instance side). Even methods that are overridden on a subclass can still be called using ?super method?. This is a fundamental piece of learning Smalltalk and not simple to understand, but it is also one of those things that is really easy to learn, and once you do you really don?t think about it anymore. It just seems natural. (and when it?s missing in other languages you go yuck! Why is this so difficult!). It also means that people that understand it think that it?s simple and natural and may not spend enough time talking about it. J One more question for you. I mentioned returning a newly created instance or a specific class from a class side method. Can you name another reason why you would write a method on the class side? Why would it be a good idea to put a method on the class side instead of the instance side? (a hint for you, I?m thinking of something where nothing is returned. (of course in Smalltalk if nothing is returned you get back self, what I mean is that nothing useful is returned)) Bonus points for 2 or more answers with or without returning something J. All the best, Ron Teitelbaum Thank you, Sincerely, Joe. _____ View this message in context: Re: FileDirectory Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160526/cd316e08/attachment.htm From joseph.alotta at gmail.com Thu May 26 19:02:10 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Thu May 26 19:39:12 2016 Subject: [Newbies] Re: FileDirectory In-Reply-To: <02e601d1b757$b7817f10$26847d30$@usmedrec.com> References: <709657E1-8F3D-42FB-94ED-EE0F9731DD3F@gmail.com> <00c301d1b6c2$c9ae77a0$5d0b66e0$@usmedrec.com> <2C3FF578-C458-4C13-AA34-2A6B133B3B85@gmail.com> <012d01d1b6db$ff9c9540$fed5bfc0$@usmedrec.com> <060F5149-A086-4E1E-87AE-562EDF7BF3D8@gmail.com> <02e601d1b757$b7817f10$26847d30$@usmedrec.com> Message-ID: > On May 26, 2016, at 8:29 AM, Ron Teitelbaum [via Smalltalk] wrote: > > One more question for you. I mentioned returning a newly created instance or a specific class from a class side method. Can you name another reason why you would write a method on the class side? When you want the class as a whole to do something. When there is only one instance of an object and other is not desirable or logical. For example, one compiler: two is not practical. One instance of the number Pi. One instance of Nil. Why would you need another? > Why would it be a good idea to put a method on the class side instead of the instance side? (a hint for you, I?m thinking of something where nothing is returned. (of course in Smalltalk if nothing is returned you get back self, what I mean is that nothing useful is returned)) Bonus points for 2 or more answers with or without returning > something J. You would put a method on the class side when the method applies to all instances of the class. For example, Window closeAllWindows. Or Process stopAllProcesses. Or Smalltalk saveImage. I don?t think this is what you had in mind, though. Sincerely, Joe. -- View this message in context: http://forum.world.st/FileDirectory-tp4897377p4897621.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160526/243337ee/attachment.htm From ron at usmedrec.com Thu May 26 20:00:47 2016 From: ron at usmedrec.com (Ron Teitelbaum) Date: Thu May 26 20:00:51 2016 Subject: [Newbies] Re: FileDirectory In-Reply-To: References: <709657E1-8F3D-42FB-94ED-EE0F9731DD3F@gmail.com> <00c301d1b6c2$c9ae77a0$5d0b66e0$@usmedrec.com> <2C3FF578-C458-4C13-AA34-2A6B133B3B85@gmail.com> <012d01d1b6db$ff9c9540$fed5bfc0$@usmedrec.com> <060F5149-A086-4E1E-87AE-562EDF7BF3D8@gmail.com> <02e601d1b757$b7817f10$26847d30$@usmedrec.com> Message-ID: <044801d1b789$4c435a20$e4ca0e60$@usmedrec.com> From: Joseph Alotta Sent: Thursday, May 26, 2016 3:02 PM > On May 26, 2016, at 8:29 AM, Ron Teitelbaum [via Smalltalk] <[hidden email]> wrote: > > One more question for you. I mentioned returning a newly created instance or a specific class from a class side method. Can you name another reason why you would write a method on the class side? When you want the class as a whole to do something. When there is only one instance of an object and other is not desirable or logical. For example, one compiler: two is not practical. One instance of the number Pi. One instance of Nil. Why would you need another? [Ron Teitelbaum] if there is one instance you would still write methods on the instance side. But yes having a class side method that provides your single instance makes sense. > Why would it be a good idea to put a method on the class side instead of the instance side? (a hint for you, I?m thinking of something where nothing is returned. (of course in Smalltalk if nothing is returned you get back self, what I mean is that nothing useful is returned)) Bonus points for 2 or more answers with or without returning > something J. You would put a method on the class side when the method applies to all instances of the class. For example, Window closeAllWindows. Or Process stopAllProcesses. Or Smalltalk saveImage. I don?t think this is what you had in mind, though. [Ron Teitelbaum] This was exactly what I had in mind. When you have a method that does something to all instances or is needed to find a specific instance it makes sense to implement that as a class side method. Extra credit: Why would you use a class variable? We know that an instance variable is used to store data within the context of an instance. Why would you want to store data in the context of a class? All the best, Ron Teitelbaum Sincerely, Joe. _____ View this message in context: Re: FileDirectory Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160526/6bda52af/attachment-0001.htm From joseph.alotta at gmail.com Thu May 26 20:32:00 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Thu May 26 21:09:04 2016 Subject: [Newbies] Re: FileDirectory In-Reply-To: <044801d1b789$4c435a20$e4ca0e60$@usmedrec.com> References: <709657E1-8F3D-42FB-94ED-EE0F9731DD3F@gmail.com> <00c301d1b6c2$c9ae77a0$5d0b66e0$@usmedrec.com> <2C3FF578-C458-4C13-AA34-2A6B133B3B85@gmail.com> <012d01d1b6db$ff9c9540$fed5bfc0$@usmedrec.com> <060F5149-A086-4E1E-87AE-562EDF7BF3D8@gmail.com> <02e601d1b757$b7817f10$26847d30$@usmedrec.com> <044801d1b789$4c435a20$e4ca0e60$@usmedrec.com> Message-ID: > Extra credit: Why would you use a class variable? We know that an instance variable is used to store data within the context of an instance. Why would you want to store data in the context of a class? Window closeAllWindows needs to have a list of all the windows, and sends each one the close message. Or if a instance of a class needed to communicate with other members of its class. For example, a class of helicopter bots that fly together as a group. They would need talk to each other to avoid collisions. Sincerely, Joe. -- View this message in context: http://forum.world.st/FileDirectory-tp4897377p4897633.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160526/38ea2836/attachment.htm From ron at usmedrec.com Thu May 26 21:14:44 2016 From: ron at usmedrec.com (Ron Teitelbaum) Date: Thu May 26 21:14:48 2016 Subject: [Newbies] Re: FileDirectory In-Reply-To: References: <709657E1-8F3D-42FB-94ED-EE0F9731DD3F@gmail.com> <00c301d1b6c2$c9ae77a0$5d0b66e0$@usmedrec.com> <2C3FF578-C458-4C13-AA34-2A6B133B3B85@gmail.com> <012d01d1b6db$ff9c9540$fed5bfc0$@usmedrec.com> <060F5149-A086-4E1E-87AE-562EDF7BF3D8@gmail.com> <02e601d1b757$b7817f10$26847d30$@usmedrec.com> <044801d1b789$4c435a20$e4ca0e60$@usmedrec.com> Message-ID: <049b01d1b793$a0bd96b0$e238c410$@usmedrec.com> From: Joseph Alotta Sent: Thursday, May 26, 2016 4:32 PM > Extra credit: Why would you use a class variable? We know that an instance variable is used to store data within the context of an instance. Why would you want to store data in the context of a class? Window closeAllWindows needs to have a list of all the windows, and sends each one the close message. Or if a instance of a class needed to communicate with other members of its class. For example, a class of helicopter bots that fly together as a group. They would need talk to each other to avoid collisions. [Ron Teitelbaum] Exactly! Well done. Any dynamic information that is related to all or a collection of instances should be held on a class variable. You could of course create a framework by adding another object whose job it is to manage all these instances. Then your class variable becomes an instance variable on your manager class. It could also be used for a class with just one instance. Create it and store it so that it's reused when asked for a second time. You will see that a lot, ^Instance ifNil: [Instance := self new. Instance]. Nice job! Ron Sincerely, Joe. _____ View this message in context: Re: FileDirectory Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160526/2245a942/attachment.htm From joseph.alotta at gmail.com Thu May 26 20:52:48 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Thu May 26 21:29:52 2016 Subject: [Newbies] Re: FileDirectory In-Reply-To: <049b01d1b793$a0bd96b0$e238c410$@usmedrec.com> References: <709657E1-8F3D-42FB-94ED-EE0F9731DD3F@gmail.com> <00c301d1b6c2$c9ae77a0$5d0b66e0$@usmedrec.com> <2C3FF578-C458-4C13-AA34-2A6B133B3B85@gmail.com> <012d01d1b6db$ff9c9540$fed5bfc0$@usmedrec.com> <060F5149-A086-4E1E-87AE-562EDF7BF3D8@gmail.com> <02e601d1b757$b7817f10$26847d30$@usmedrec.com> <044801d1b789$4c435a20$e4ca0e60$@usmedrec.com> <049b01d1b793$a0bd96b0$e238c410$@usmedrec.com> Message-ID: I saw a lot of code in FileDirectory for urls. What?s that all about? Can I use FileDirectory to browse the web? If not, is there another web browser object? Sincerely, Joe. -- View this message in context: http://forum.world.st/FileDirectory-tp4897377p4897636.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160526/85fb7b58/attachment.htm From ron at usmedrec.com Thu May 26 23:27:00 2016 From: ron at usmedrec.com (Ron Teitelbaum) Date: Thu May 26 23:27:03 2016 Subject: [Newbies] Re: FileDirectory In-Reply-To: References: <709657E1-8F3D-42FB-94ED-EE0F9731DD3F@gmail.com> <00c301d1b6c2$c9ae77a0$5d0b66e0$@usmedrec.com> <2C3FF578-C458-4C13-AA34-2A6B133B3B85@gmail.com> <012d01d1b6db$ff9c9540$fed5bfc0$@usmedrec.com> <060F5149-A086-4E1E-87AE-562EDF7BF3D8@gmail.com> <02e601d1b757$b7817f10$26847d30$@usmedrec.com> <044801d1b789$4c435a20$e4ca0e60$@usmedrec.com> <049b01d1b793$a0bd96b0$e238c410$@usmedrec.com> Message-ID: <04e801d1b7a6$1afd5840$50f808c0$@usmedrec.com> Have a look at the Hierarchy for the class Url Notice the class method: #urlClassForScheme: That should give you a better understanding of why url methods are in FileDirectory. For browser like methods see HTTPClient. All the best, Ron Teitelbaum From: beginners-bounces@lists.squeakfoundation.org [mailto:beginners-bounces@lists.squeakfoundation.org] On Behalf Of Joseph Alotta Sent: Thursday, May 26, 2016 4:53 PM To: beginners@lists.squeakfoundation.org Subject: [Newbies] Re: FileDirectory I saw a lot of code in FileDirectory for urls. What?s that all about? Can I use FileDirectory to browse the web? If not, is there another web browser object? Sincerely, Joe. _____ View this message in context: Re: FileDirectory Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160526/620eb179/attachment.htm From btc at openinworld.com Fri May 27 03:20:27 2016 From: btc at openinworld.com (Ben Coman) Date: Fri May 27 03:20:49 2016 Subject: [Newbies] Re: FileDirectory In-Reply-To: References: <709657E1-8F3D-42FB-94ED-EE0F9731DD3F@gmail.com> <00c301d1b6c2$c9ae77a0$5d0b66e0$@usmedrec.com> <2C3FF578-C458-4C13-AA34-2A6B133B3B85@gmail.com> <012d01d1b6db$ff9c9540$fed5bfc0$@usmedrec.com> <060F5149-A086-4E1E-87AE-562EDF7BF3D8@gmail.com> <02e601d1b757$b7817f10$26847d30$@usmedrec.com> Message-ID: On Fri, May 27, 2016 at 3:02 AM, Joseph Alotta wrote: > >> On May 26, 2016, at 8:29 AM, Ron Teitelbaum [via Smalltalk] <[hidden >> email]> wrote: >> >> One more question for you. I mentioned returning a newly created instance >> or a specific class from a class side method. Can you name another reason >> why you would write a method on the class side? > > When there is only one > instance of an object and other is not desirable or logical. > > For example, one compiler: two is not practical. One instance of the number > Pi. One instance of Nil. Why would you need another? One downside of this approach is that it can make developing/running unit tests harder when your tests are changing global state - which is what class variables kind-of are. cheers -ben > >> Why would it be a good idea to put a method on the class side instead of >> the instance side? (a hint for you, I?m thinking of something where nothing >> is returned. (of course in Smalltalk if nothing is returned you get back >> self, what I mean is that nothing useful is returned)) Bonus points for 2 or >> more answers with or without returning >> something J. > > You would put a method on the class side when the method applies to all > instances of the class. For example, Window closeAllWindows. Or Process > stopAllProcesses. Or Smalltalk saveImage. > > I don?t think this is what you had in mind, though. > > Sincerely, > > Joe. > > > > ________________________________ > View this message in context: Re: FileDirectory > Sent from the Squeak - Beginners mailing list archive at Nabble.com. > > _______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners > From joseph.alotta at gmail.com Tue May 31 18:16:12 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Tue May 31 18:53:51 2016 Subject: [Newbies] Re: FileDirectory In-Reply-To: <04e801d1b7a6$1afd5840$50f808c0$@usmedrec.com> References: <2C3FF578-C458-4C13-AA34-2A6B133B3B85@gmail.com> <012d01d1b6db$ff9c9540$fed5bfc0$@usmedrec.com> <060F5149-A086-4E1E-87AE-562EDF7BF3D8@gmail.com> <02e601d1b757$b7817f10$26847d30$@usmedrec.com> <044801d1b789$4c435a20$e4ca0e60$@usmedrec.com> <049b01d1b793$a0bd96b0$e238c410$@usmedrec.com> <04e801d1b7a6$1afd5840$50f808c0$@usmedrec.com> Message-ID: > On May 26, 2016, at 5:50 PM, Ron Teitelbaum [via Smalltalk] wrote: > > Have a look at the Hierarchy for the class Url > > > > Notice the class method: #urlClassForScheme: > > > > That should give you a better understanding of why url methods are in FileDirectory. > > > > For browser like methods see HTTPClient. Sorry, Ron, all I got from this email after a day of trying to understand it, is that I do not have the background to grasp what you are trying to tell me. It seems you need to know all of this already before you know how to use it. I thought the purpose of encapsulation is that you do not need to know the inner workings of an object to use it. Is there something more basic about urls and httpclients that I can start with? Sincerely, Joe. -- View this message in context: http://forum.world.st/FileDirectory-tp4897377p4898427.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160531/242e74ce/attachment.htm From ron at usmedrec.com Tue May 31 21:05:29 2016 From: ron at usmedrec.com (Ron Teitelbaum) Date: Tue May 31 21:05:26 2016 Subject: [Newbies] Re: FileDirectory In-Reply-To: References: <2C3FF578-C458-4C13-AA34-2A6B133B3B85@gmail.com> <012d01d1b6db$ff9c9540$fed5bfc0$@usmedrec.com> <060F5149-A086-4E1E-87AE-562EDF7BF3D8@gmail.com> <02e601d1b757$b7817f10$26847d30$@usmedrec.com> <044801d1b789$4c435a20$e4ca0e60$@usmedrec.com> <049b01d1b793$a0bd96b0$e238c410$@usmedrec.com> <04e801d1b7a6$1afd5840$50f808c0$@usmedrec.com> Message-ID: <124201d1bb80$29958d90$7cc0a8b0$@usmedrec.com> Hi Joe, There are a number of different types of resource names. One of them is a URI the other is URL (I=Indenter L=Locator). They are ways for locating and identifying resources so that computers can find and work with them. I would recommend googling a bit about URI and URL to understand better what they are used for. The section I pointed out was a method that gave you the protocol (scheme) for the URL. URL class >> urlClassForScheme: scheme (scheme isNil or: [scheme = 'http']) ifTrue: [^HttpUrl]. scheme = 'https' ifTrue: [^HttpUrl]. scheme = 'ftp' ifTrue: [^FtpUrl]. scheme = 'file' ifTrue: [^FileUrl]. scheme = 'mailto' ifTrue: [^MailtoUrl]. scheme = 'browser' ifTrue: [^BrowserUrl]. ^GenericUrl This is a class side method that returns the class you should use to work with the resource. You asked why there were url methods on FileDirectory. The answer is that a url instead of starting with http as in http://mydomain.com/somefilename can start with file:// as in file://somefilename and this is how we get to FileDirectory (well eventually through FileUrl), that's what I was trying to point out. All the best, Ron From: beginners-bounces@lists.squeakfoundation.org [mailto:beginners-bounces@lists.squeakfoundation.org] On Behalf Of Joseph Alotta Sent: Tuesday, May 31, 2016 2:16 PM To: beginners@lists.squeakfoundation.org Subject: [Newbies] Re: FileDirectory > On May 26, 2016, at 5:50 PM, Ron Teitelbaum [via Smalltalk] <[hidden email]> wrote: > > Have a look at the Hierarchy for the class Url > > > > Notice the class method: #urlClassForScheme: > > > > That should give you a better understanding of why url methods are in FileDirectory. > > > > For browser like methods see HTTPClient. Sorry, Ron, all I got from this email after a day of trying to understand it, is that I do not have the background to grasp what you are trying to tell me. It seems you need to know all of this already before you know how to use it. I thought the purpose of encapsulation is that you do not need to know the inner workings of an object to use it. Is there something more basic about urls and httpclients that I can start with? Sincerely, Joe. _____ View this message in context: Re: FileDirectory Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160531/efdc4065/attachment.htm