From lists at dcorking.com Fri Jun 5 12:35:01 2009 From: lists at dcorking.com (David Corking) Date: Fri, 5 Jun 2009 11:35:01 +0100 Subject: [sbe-discussion] Re: Newbie and versions Message-ID: John, I stumbled on your message today and was surprised you had not received a reply. I have since had similar but not identical experiences with SBEGame - I think they helped me learn a little more, and reminded my that my typing is not perfect. Did you fix your problem yet? You wrote (on March 17): > After asking Squeak to accept the initialize method for SBEGame, according to the book, > a box should (?) come up 'Unknown selector...' as shown in Fig 2.8, p.37. > This does not appear. The box 'Unknown variable...' > does appear but only shows 'declare temp', 'declare instance' - not > 'bounds' or 'color' as shown in Fig. 2.9. Squeak was working through your code identifying possible typing errors one by one. It probably found another unknown variable before the unknown selector. It won't find the unknown selector until you deal with the variable. In the title bar of the dialogue 'Unknown variable: ' the next word is the name of the unknown variable. That is your clue. My guess is a typing error in lines 2 or 4. Have you used pipe symbols '|' in line 2? > I notice that n in the code appears in italic and underlined which I assume > means it is not recognized. Do you mean the 'n' at the start of line 4? The underlining indeed means it is unknown. (The grey italic just means that it is a temp variable.) Have fun! David From lists at dcorking.com Mon Jun 15 11:04:34 2009 From: lists at dcorking.com (David Corking) Date: Mon, 15 Jun 2009 10:04:34 +0100 Subject: [sbe-discussion] asCharacter is deprecated by Pharo Message-ID: A note for when you update SBE to Pharo: The example on page 141 of SBE uses a method, String>>asCharacter that has been tagged as "self deprecated: 'evil'" in Pharo 0.1. This means that Method 6.2 produces a deprecation warning. An alternative should be written into the updated book. Also, I would be interested to know what you recommend as an alternative. The method comment merely says "Idiosyncratic, provisional" which I agree with, but it does not mention a replacement. Should an application merely replicate the simple implementation of the method in its code, with more appropriate handling of a null string? David From oscar at iam.unibe.ch Mon Jun 15 11:25:08 2009 From: oscar at iam.unibe.ch (Oscar Nierstrasz) Date: Mon, 15 Jun 2009 11:25:08 +0200 Subject: [sbe-discussion] Re: asCharacter is deprecated by Pharo In-Reply-To: References: Message-ID: Hi David, Thanks for pointing this out. In this case I will simply replace the message with "first". In case FileDirectory dot returns a null string, we should get a debugger window anyway. Cheers, Oscar On Jun 15, 2009, at 11:04, David Corking wrote: > A note for when you update SBE to Pharo: > > The example on page 141 of SBE uses a method, String>>asCharacter that > has been tagged as "self deprecated: 'evil'" in Pharo 0.1. This means > that Method 6.2 produces a deprecation warning. > > An alternative should be written into the updated book. > > Also, I would be interested to know what you recommend as an > alternative. The method comment merely says "Idiosyncratic, > provisional" which I agree with, but it does not mention a > replacement. Should an application merely replicate the simple > implementation of the method in its code, with more appropriate > handling of a null string? > > David > _______________________________________________ > Sbe-discussion mailing list > Sbe-discussion at iam.unibe.ch > https://www.iam.unibe.ch/mailman/listinfo/sbe-discussion From lists at dcorking.com Mon Jun 15 11:35:56 2009 From: lists at dcorking.com (David Corking) Date: Mon, 15 Jun 2009 10:35:56 +0100 Subject: [sbe-discussion] Re: asCharacter is deprecated by Pharo In-Reply-To: References: Message-ID: Oscar Nierstrasz wrote: > In case FileDirectory dot returns a null string, we should get a debugger > window anyway. Thanks, Oscar: I agree. It is a shame that using 'first' will break the polymorphism of 'asCharacter' in Pharo applications - but I can't see a good alternative.