tim Rowledge uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-tpr.539.mcz ==================== Summary ==================== Name: Collections-tpr.539 Author: tpr Time: 8 October 2013, 2:48:12.552 pm UUID: e33fd51f-59a0-41ab-bbee-08a8a969f31a Ancestors: Collections-cmm.538 Strings need to understand how to delegate character scanning to the next stage of the process =============== Diff against Collections-cmm.538 =============== Item was added: + ----- Method: ByteString>>scanCharactersFrom:to:with:rightX:font: (in category 'character scanning') ----- + scanCharactersFrom: startIndex to: stopIndex with: aCharacterScanner rightX: rightX font: aFont + "NB: strongly consider getting almost all these parameters from the scanner" + "Since I'm a byte char string, I know that we have to scan single-byte characters and don't have to handle encodings etc" + startIndex > stopIndex + ifTrue: [^aCharacterScanner handleEndOfRunAt: stopIndex]. + ^aFont scanByteCharactersFrom: startIndex to: stopIndex in: self with: aCharacterScanner rightX: rightX! Item was added: + ----- Method: WideString>>scanCharactersFrom:to:with:rightX:font: (in category 'character scanning') ----- + scanCharactersFrom: startIndex to: stopIndex with: aCharacterScanner rightX: rightX font: aFont + "NB: strongly consider getting almost all these parameters from the scanner" + "Since I'm a wide char string, I know that we have to scan multi-byte characters and handle encodings etc" + | charSet | + startIndex > stopIndex + ifTrue: [^aCharacterScanner handleEndOfRunAt: stopIndex]. + charSet := self encodedCharSetAt: startIndex. + ^charSet scanMultibyteCharactersFrom: startIndex to: stopIndex in: self with: aCharacterScanner rightX: rightX font: aFont ! |
Ah, so you don't pass the stopConditions and kern, good :) I think it is a good thing, because those were ALWAYS equal to the scanner inst vars.
2013/10/8 <[hidden email]> tim Rowledge uploaded a new version of Collections to project The Trunk: |
On 08-10-2013, at 2:52 PM, Nicolas Cellier <[hidden email]> wrote: > Ah, so you don't pass the stopConditions and kern, good :) > I think it is a good thing, because those were ALWAYS equal to the scanner inst vars. Exactly; I tried to pass only the objects that would actually help yet not fall into the ugly-trap of perpetually sending trivial accessors back to the scanner. Next part is just coming out, where the final hookup gets done. As long as I've remembered right, I don't need to make an update .mcm since it is a separate update... tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim Fractured Idiom:- HARLEZ-VOUS FRANCAIS? - Can you drive a French motorcycle? |
? I just added one .mcm.No, it seems that an update is necessary, due to load order (you must have methods from OrderedCollection and Multilingual loaded first) 2013/10/9 tim Rowledge <[hidden email]>
|
In reply to this post by commits-2
Why aren't these methods in the Graphics package?
Levente On Tue, 8 Oct 2013, [hidden email] wrote: > tim Rowledge uploaded a new version of Collections to project The Trunk: > http://source.squeak.org/trunk/Collections-tpr.539.mcz > > ==================== Summary ==================== > > Name: Collections-tpr.539 > Author: tpr > Time: 8 October 2013, 2:48:12.552 pm > UUID: e33fd51f-59a0-41ab-bbee-08a8a969f31a > Ancestors: Collections-cmm.538 > > Strings need to understand how to delegate character scanning to the next stage of the process > > =============== Diff against Collections-cmm.538 =============== > > Item was added: > + ----- Method: ByteString>>scanCharactersFrom:to:with:rightX:font: (in category 'character scanning') ----- > + scanCharactersFrom: startIndex to: stopIndex with: aCharacterScanner rightX: rightX font: aFont > + "NB: strongly consider getting almost all these parameters from the scanner" > + "Since I'm a byte char string, I know that we have to scan single-byte characters and don't have to handle encodings etc" > + startIndex > stopIndex > + ifTrue: [^aCharacterScanner handleEndOfRunAt: stopIndex]. > + ^aFont scanByteCharactersFrom: startIndex to: stopIndex in: self with: aCharacterScanner rightX: rightX! > > Item was added: > + ----- Method: WideString>>scanCharactersFrom:to:with:rightX:font: (in category 'character scanning') ----- > + scanCharactersFrom: startIndex to: stopIndex with: aCharacterScanner rightX: rightX font: aFont > + "NB: strongly consider getting almost all these parameters from the scanner" > + "Since I'm a wide char string, I know that we have to scan multi-byte characters and handle encodings etc" > + | charSet | > + startIndex > stopIndex > + ifTrue: [^aCharacterScanner handleEndOfRunAt: stopIndex]. > + charSet := self encodedCharSetAt: startIndex. > + ^charSet scanMultibyteCharactersFrom: startIndex to: stopIndex in: self with: aCharacterScanner rightX: rightX font: aFont ! > > > |
+1 that makes sense, and update would be simpler. 2013/10/9 Levente Uzonyi <[hidden email]> Why aren't these methods in the Graphics package? |
In reply to this post by Nicolas Cellier
On 08-10-2013, at 3:32 PM, Nicolas Cellier <[hidden email]> wrote: > ? > No, it seems that an update is necessary, due to load order > (you must have methods from OrderedCollection and Multilingual loaded first) > I just added one .mcm. Sigh. thanks for doing that. I really thought I understood it this time... tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim Strange OpCodes: SNARF: System Normalize And Reset Flags |
In reply to this post by Levente Uzonyi-2
On 08-10-2013, at 3:38 PM, Levente Uzonyi <[hidden email]> wrote: > Why aren't these methods in the Graphics package? Because they seemed perfectly happy in the collections. If that bothers you enough that you want to change it, I won't be at all offended. I don't *think* it causes any problems with package boundaries but there's only so many things I can think of at once and the glory of a flexible system is that somebody else that *does* have time to think of some other aspect can chime in to improve things. tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim Strange OpCodes: SNARF: System Normalize And Reset Flags |
Free forum by Nabble | Edit this page |