This is a nice little enhancement by Chris Norton that helps Squeak to speak gooder English.
It was timed out on the BFAV list, so I am posting with a different subject line. The attached change set is the original one, and works fine in a 3.7 image.
Here is the original message posted by Chris in January 2000:
Hi Folks.
Here's the preamble from my changeset:
"OK. You could say that this is a silly crusade, but I like my Squeak messages to be in proper English (at least when the language you're using is English). I was messing around with the HangMan file-in and I got a walkback that had the following title: 'Error: HangManPhrases classs are not indexable'. I just couldn't stand the extra 's' on 'class', so I created a nifty new String method called asPlural and I modified the sender of the odd string to use the new String modifier. Take it or leave it, but I think this makes auto-generated text just a little easier to read."
I hope you find this new String modifier useful too.
Cheers!
---==> Chris
Hmm... I should have posted this earlier since this ENH just got included, but does anyone else find the selector #asPlural problematic? I always think of #as... specifying a new class and there is no Plural class. I'd suggest something more like #pluralized (though then we get into the debate of whether to use an S or a Z :) ).
I actually find the whole method somewhat suspect since it ends up being a whole lot of special cases but Andrew insists on using a similar mechanism (in fact, with the same objectionable selector) at work and I can't quite put my finger on a better solution.
Anyway, not a huge deal (and I certainly take my lumps for not speaking up sooner) but better late than never I guess.
David T. Lewis wrote:
This is a nice little enhancement by Chris Norton that helps Squeak to speak gooder English.
It was timed out on the BFAV list, so I am posting with a different subject line. The attached change set is the original one, and works fine in a 3.7 image.
Here is the original message posted by Chris in January 2000:
Hi Folks.
Here's the preamble from my changeset:
"OK. You could say that this is a silly crusade, but I like my Squeak messages to be in proper English (at least when the language you're using is English). I was messing around with the HangMan file-in and I got a walkback that had the following title: 'Error: HangManPhrases classs are not indexable'. I just couldn't stand the extra 's' on 'class', so I created a nifty new String method called asPlural and I modified the sender of the odd string to use the new String modifier. Take it or leave it, but I think this makes auto-generated text just a little easier to read."
I hope you find this new String modifier useful too.
Cheers!
---==> Chris
Julian Fitzell julian@beta4.com wrote:
Hmm... I should have posted this earlier since this ENH just got included, but does anyone else find the selector #asPlural problematic? I always think of #as... specifying a new class and there is no Plural class. I'd suggest something more like #pluralized (though then we get into the debate of whether to use an S or a Z :) ).
#inPlural perhaps? :)
regards, Göran
"goran.krampe@bluefish.se" 06/08/04 09:12 >>>
Julian Fitzell julian@beta4.com wrote:
Hmm... I should have posted this earlier since this ENH just got included, but does anyone else find the selector #asPlural
problematic?> I always think of #as... specifying a new class and there is no Plural> class. I'd suggest something more like #pluralized (though then we get> into the debate of whether to use an S or a Z :) ).
I recently had an argument with a friend who is as pedantic as I. I maintained that S is the One True Way and Z a heathen American invention. Unfortunately, he blew my argument out of the water with this link:
http://www.askoxford.com/asktheexperts/faq/aboutspelling/ize?view=uk
Thus, unfortunately, I had to admit crimson, shame-faced defeat - Z is perfectly correct on both sides of the pond. At least for words like "pluralise". I know, I know - there dies a perfect opportunity for a flame war!
frank
I think asPlural adds a stumbling block on the way to a fully localized squeak. The only use of asPlural by now is in Object errorNotIndexable:
self error: self class name asPlural , ' are not indexable'
This can be easily rewritten as:
self error: ('Instances of class {1} are not indexable' translated format: self class name)
This might not look as slick as before but circumvents creating the plural form of a word and it is translatable. If asPlural stays in the image and gets more used beside the context of the programming environment, there will be a need for language specific versions of that method. And they might be not as easy to write as the current one.
I'm by no means an expert on that topic, but I feel we should leave out methods that generate language in favour of an easier to translate squeak image.
Just my 2 eurocents, Alex
This was missing some braces and maybe the word 'class' can be left out:
self error: ('Instances of {1} are not indexable' translated format: {self class name})
Alex
Alexander Lazarevic wrote:
I think asPlural adds a stumbling block on the way to a fully localized squeak. The only use of asPlural by now is in Object errorNotIndexable:
self error: self class name asPlural , ' are not indexable'
Does anyone else feel that just because we *can* extend base classes such as String with all kinds of logic, that doesn't mean we *have* to?
The concept here seems to me to be "plural".
So, why not make a class to represent it, and get:
Plural of: self class name
This allows for other classes than String, such as Symbol, to be handled too, and for a class comment in Plural that explains what the class does and why, and some guidelines for how to use it, and for subclasses, and so many other benefits. And it doesn't clutter up String with the *logic* for pluralizing (I don't see much harm in giving it a method #pluralForm as a convenience method).
Cheers,
Peter
Hello,
Wow, I wasn't aware that this kind of thing gets into the 3.7 update stream until today. I was thinking that it is better for it to reside out of the main stream image, and somehow imagining that it does a bit better job anyway...
'city' asPlural => 'citys' (facility, lady, ...) ('day' asPlural => 'days') (toy, key, ...)
'fox' asPlural => 'foxs' (box, bus, flash, ...)
'knife' asPlural => 'knifes. (wife, wolf, scarf, ...) ('roof' asPlural => 'roofs') (chief, ...) 'tomato' asPlural => 'tomatos' (potato, ...) ('piano' asPlural => 'pianos') (cello, ...)
'fish' asPlural => 'fishs' (deer, sheep, ...)
'man' asPlural => 'mans' (child, mouse, foot, ...)
'stimulus' asPlural => 'stimuluses' (...)
I guess that learning the irregular plural, (and especially the rules for irregulars) were important for non-native speakers, but probably not for the natives...
Do you guys mind if I take it out from the coming 3.8?
-- Yoshiki
As I wrote in (1) I would love to see this removed.
Alex
(1) http://lists.squeakfoundation.org/pipermail/squeak-dev/2004-June/078880.html
Hi,
I second your opinion. I do not think the method is necessary for the core image.
Tue, 29 Jun 2004 09:40:24 +0200 Alexander_Lazarevi� Alexander@Lazarevic.de wrote:
As I wrote in (1) I would love to see this removed.
Alex
(1) http://lists.squeakfoundation.org/pipermail/squeak-dev/2004-June/078880.html
--- [:masashi | ^umezawa]
Me too... I'd like it out before 3.7 - there was quite a bit of discussion about better ways to do this but I think the general point that people wanted it removed from 3.7 was lost. I think this is pretty broken code as it currently stands.
Julian
Masashi Umezawa wrote:
Hi,
I second your opinion. I do not think the method is necessary for the core image.
Tue, 29 Jun 2004 09:40:24 +0200 Alexander_Lazareviæ Alexander@Lazarevic.de wrote:
As I wrote in (1) I would love to see this removed.
Alex
(1) http://lists.squeakfoundation.org/pipermail/squeak-dev/2004-June/078880.html
[:masashi | ^umezawa]
On Tue, Jun 29, 2004 at 06:20:52PM +0900, Masashi Umezawa wrote:
Hi,
I second your opinion. I do not think the method is necessary for the core image.
Tue, 29 Jun 2004 09:40:24 +0200 Alexander_Lazareviæ Alexander@Lazarevic.de wrote:
As I wrote in (1) I would love to see this removed.
Alex
(1) http://lists.squeakfoundation.org/pipermail/squeak-dev/2004-June/078880.html
I am the person who reposted this change set, and I agree that it should be removed. If it can be taken out of the 3.7 release stream without too much trouble, that would be good. Otherwise, it should be removed for 3.8.
Dave
David,
I am the person who reposted this change set, and I agree that it should be removed. If it can be taken out of the 3.7 release stream without too much trouble, that would be good. Otherwise, it should be removed for 3.8.
I've posted a possible removal and fix changeset. Can you take a look at it?
-- Yoshiki
On Tue, Jun 29, 2004 at 03:08:27PM -0700, Yoshiki Ohshima wrote:
David,
I am the person who reposted this change set, and I agree that it should be removed. If it can be taken out of the 3.7 release stream without too much trouble, that would be good. Otherwise, it should be removed for 3.8.
I've posted a possible removal and fix changeset. Can you take a look at it?
I have reviewed this [FIX] in BFAV.
Thank you very much, the removal and the fix both look good.
On Tue, Jun 29, 2004 at 08:54:36PM -0400, David T. Lewis wrote:
On Tue, Jun 29, 2004 at 03:08:27PM -0700, Yoshiki Ohshima wrote:
I've posted a possible removal and fix changeset. Can you take a look at it?
I have reviewed this [FIX] in BFAV.
Thank you very much, the removal and the fix both look good.
Oh, and thanks also to Alexander Lazarevic who originally proposed the simple fix for the bad English grammar:
self error: ('Instances of {1} are not indexable' translated format: {self class name})
Alex and everyone,
As I wrote in (1) I would love to see this removed.
Alex
(1) http://lists.squeakfoundation.org/pipermail/squeak-dev/2004-June/078880.html
I remember this one from you (and others from the others) and thought it wasn't going to get into the update stream...
By the way, I noticed that even with the changeset, evaluating
Integer at: 3
still ends up with
"Error: Integer classs are not indexable". Hmm.
I browsed the intersection of the senders of #error: and #class (I admit it wouldn't be sufficient), and spotted another similar "pluralization". Also, I found a quite-not-so-English statement in another method.
Attached change set is a proposed fix for those. The wordings for error message are borrowed from Alex' proposal.
-- Yoshiki
This change set removes an earlier change that caused problems. It addresses the original symptoms by fixing awkward English grammar in several places, and adds #translated where appropriate. Looks good, works well. If this can still be included in 3.7, I recommend doing so.
squeak-dev@lists.squeakfoundation.org