[Pharo-project] Interesting expression...
displayScannerFor: para foreground: foreColor background: backColor ignoreColorChanges: shadowMode "Fixed to answer a MultiDisplayScanner when the paragraph is any kind of MultiNewParagraph (rather than an instance of the one class) or the paragraph text string is a WideString." ((para isKindOf: MultiNewParagraph) or: [para text string isByteString or: [para text string isWideString]]) this one is quite interesting, for what kind of strings in pharo a given expression yields false? string isByteString or: [ string isWideString] ? i think this code could be rewritten to true ifTrue: [ ... ]. -- Best regards, Igor Stasenko.
Igor, I think you've half reason about the quality of the test, but in a dynamic language like Smalltalk there is no warranty string wouldn't be anything else than a String. . . Em 19/09/2011 12:28, Igor Stasenko < siguctua@gmail.com > escreveu: displayScannerFor: para foreground: foreColor background: backColor ignoreColorChanges: shadowMode "Fixed to answer a MultiDisplayScanner when the paragraph is any kind of MultiNewParagraph (rather than an instance of the one class) or the paragraph text string is a WideString." ((para isKindOf: MultiNewParagraph) or: [para text string isByteString or: [para text string isWideString]]) this one is quite interesting, for what kind of strings in pharo a given expression yields false? string isByteString or: [ string isWideString] ? i think this code could be rewritten to true ifTrue: [ ... ]. -- Best regards, Igor Stasenko.
On 20 September 2011 18:52, <csrabak@bol.com.br> wrote:
Igor,
I think you've half reason about the quality of the test, but in a dynamic language like Smalltalk there is no warranty string wouldn't be anything else than a String. . .
in theory , yes. But in practice it is different. The text displaying code is extremely "practical" one. Because it should be fast. And i don't see reason why it should accept anything else than strings there.
Em 19/09/2011 12:28, Igor Stasenko < siguctua@gmail.com > escreveu: displayScannerFor: para foreground: foreColor background: backColor ignoreColorChanges: shadowMode  "Fixed to answer a MultiDisplayScanner when the paragraph is any kind of  MultiNewParagraph (rather than an instance of the one class) or the paragraph  text string is a WideString."
 ((para isKindOf: MultiNewParagraph) or: [para text string isByteString  or: [para text string isWideString]])
this one is quite interesting, for what kind of strings in pharo a given expression yields false?
 string isByteString or: [ string isWideString]
?
i think this code could be rewritten to
true ifTrue: [ Â ...
].
-- Best regards, Igor Stasenko.
-- Best regards, Igor Stasenko.
On 20.09.2011 19:18, Igor Stasenko wrote:
On 20 September 2011 18:52,<csrabak@bol.com.br> wrote:
Igor,
I think you've half reason about the quality of the test, but in a dynamic language like Smalltalk there is no warranty string wouldn't be anything else than a String. . .
in theory , yes. But in practice it is different.
The text displaying code is extremely "practical" one. Because it should be fast. And i don't see reason why it should accept anything else than strings there. IIRC, I've been bitten in the past with Text instances being passed to the rendering methods, not sure if the same holds true for the scanner...
Cheers, Henry
participants (3)
-
csrabak@bol.com.br -
Henrik Sperre Johansen -
Igor Stasenko