[Pharo-project] ClassBuilder depending -in some way- on text

Igor Stasenko siguctua at gmail.com
Thu Mar 8 20:17:24 EST 2012


On 9 March 2012 01:22, Guillermo Polito <guillermopolito at gmail.com> wrote:
> ClassBuilder>>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].
>     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
>
>
> Is it right to do that asText allBold there? :S
> Shouldn't an exception be raised instead?
>
> Do I open a ticket?
>
Yes.
We should kill dependency by removing asText asBold.
Notifications should not accept rich-formatted text anyways,
because not all ui managers can handle it  (now we having command-line
ui manager
which prints message on console).

> Guille



-- 
Best regards,
Igor Stasenko.




More information about the Pharo-dev mailing list