If I'm writing code for a project I mean to share, I write the code in english of course. But at my work, where I have to deal with very specific vocabulary that could be almost ridiculous to translate, I feel more comfortable writing in spanish (my native language) and not forcing the domain to be translated. I don't think it's a beginner's thing, I think it's just confortable for anyone depending on the objective of the project and working context. But yes, I find myself writing ugly selectors like "add*Indice*:" instead of "addIndex:" or "*agregarIndice*:" and stuff like that, but I choose to see "add..." more as a convention instead of another language :P Even if I were writing in english, I'd follow that convention. "*Indice*" means a domain specific concept in my work, and might even be confused with some collection index, for example. Besides all this, it's something that happens not only in Smalltalk but any language I can think about, specially if you use shared libraries or frameworks. The thing here is that Smalltalk classes must begin with capital letters. But what if your language doesn't have capital letters, even more funny, what if it doesn't have any *letters*? XD And thinking about that, here's a newbie and maybe stupid question: why do classes have to begin with a capital letter? Is it a technical issue or just following conventions? If the answer is following conventions*... well... just as I follow the "add" convention, unfortunately I'd suggest following the "classes with capital letters in ASCII" too :( :( *or maybe classes are identified as such by the compiler when they begin with capital letters *because* of the existing convention... Carla On Wed, Jul 28, 2010 at 5:48 PM, Alexandre Bergel <alexandre@bergel.eu>wrote:
I'd even suggest the system to reject names and selectors not in ASCII.
I agree for what has to be put in PharoCore and Pharo. However, a user lambda must be able to create a class called MaClassePréférée if he/she wishes. Every beginner do this...
Cheers, Alexandre
Cheers, Juan Vuletich
Alexandre Bergel wrote:
I have no idea how to help you. But trying to have classes with chinese
(or any other alphabet with accents) names is important.
Even though I personally write all my code in English, many like to write code in their favorite natural language. This is what I see with students for example.
Cheers, Alexandre
On 28 Jul 2010, at 21:33, empty wrote:
In 1.1 and 1.2, without setting a language environment for Chinese, I am able to use Chinese by setting fonts. It seems to work except for accepting a class named in Chinese will end in a ClassBuilder error of 'Class names must be capitalized'. Well is it a feature(requires language environment being set correctly) or bug?
The code located being:
validateClassName: aString "Validate the new class name"
aString isSymbol ifFalse: [ ^ false ]. aString first canBeGlobalVarInitial ifFalse:[ self error: 'Class names must be capitalized'. ^false]. environ at: aString ifPresent:[:old| (old isKindOf: Behavior) ifFalse:[ self notify: aString asText allBold, ' already exists!\Proceed will store over it.' withCRs]]. ^ true
and following the code the problemic method is #canBeGlobalVarInitial: which is found in two classes: in EncodedCharSet class side: canBeGlobalVarInitial: char
| leadingChar | leadingChar := char leadingChar.
leadingChar = 0 ifTrue: [^ self isUppercase: char]. ^ self isLetter: char.
and in LanguageEnvironment
canBeGlobalVarInitial: char
^ Unicode canBeGlobalVarInitial: char.
I didn't set a Chinese environment and the exception is occured in in EncodedCharSet class since leadingChar is 0 and a Chinese char seems thought to be lowercased.
----- åç¡ä½ åç¡æ³ åç¡å§ -- View this message in context: http://forum.world.st/Pharo-1-1-1-2-and-class-names-in-Chinese-tp2305496p230... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.851 / Virus Database:
271.1.1/3030 - Release Date: 07/26/10 15:34:00
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project