I thought so. Attached hack removes it.

Jan

On 31/05/13 14:47, Marcus Denker wrote:

On May 31, 2013, at 1:32 PM, Jan Vrany <[email protected]> wrote:

Hi

is there any reason why class builder does not allow lowercase
classnames? Underscore is allowed, though.


In the past people started too add check to make sure that we only use
the naming that people are supposed to use.
The place these checks where placed was the class builder. Over time
it has shown that this is not good: it has do be done on a higher level.

(we already removed certain checks, e.g. about variable capitalization).

We should at some point introduce something that does these kinds of checks
for the tools, but allows one to just do anything when needed at the lower 
level…

        Marcus




'From Pharo2.0a of ''18 April 2012'' [Latest update: #20580] on 3 June 2013 at 
12:12:14 pm'!

!ClassBuilder methodsFor: 'validation' stamp: 'JanVrany 6/3/2013 12:12'!
validateClassName: aString
        "Validate the new class name"
        | allowed |
        aString isSymbol
                ifFalse: [ ^ false ].
        allowed := ($0 to: $9), {$_}, ($A to: $Z), ($a to: $z).
        (aString detect: [:c | (allowed includes: c) not] ifNone: [ ])
                ifNotNil: [ :c | self error: 'Invalid character: ''', c 
printString, ''''.
                        ^ false].
        
        "               
        NO, naming convetions should not be enforced at this level!!
        
        aString first canBeGlobalVarInitial ifFalse:[
                self error: 'Class names must be capitalized'.
                ^false].
        "
        environ at: aString ifPresent:[:old|
                (old isKindOf: Behavior) ifFalse:[
                        self notify: aString, ' already exists!!\Proceed will 
store over it.' withCRs]].
        ^ true! !

Reply via email to