Changes to Trunk (http://source.squeak.org/trunk.html) in the last 24 hours:
http://lists.squeakfoundation.org/pipermail/packages/2015-May/008216.html
Name: Morphic-mt.957
Ancestors: Morphic-mt.956
Allow models to trigger accept/revert changes in pluggable text morphs.
Why? Provides an additional, more general way besides context menus or keyboard shortcuts.
=============================================
http://lists.squeakfoundation.org/pipermail/packages/2015-May/008217.html
Name: MorphicTests-mt.30
Ancestors: MorphicTests-mt.29
Tests added for pluggable text morphs.
=============================================
http://lists.squeakfoundation.org/pipermail/packages/2015-May/008218.html
Name: ShoutCore-ul.48
Ancestors: ShoutCore-ul.47
SHMCClassDefinition changes:
- Implemented the missing #withAllSuperclassesDo:
- #withAllSuperclasses uses #withAllSuperclassesDo:, and returns an OrderedCollection with the classes in the same order as in Behavior's implementation.
- Recategorized some methods.
Use #withAllSuperclassesDo: instead of #withAllSuperclasses in all methods of SHParserST80.
Updated TextAction >> #shoutShouldPreserve to reflect the original intention - preserve all TextAction attributes.
Slightly faster SHTextStylerST80 >> #setAttributesIn:fromRanges:.
Removed the now useless SHTextStylerST80 >> #shouldPreserveAttribute:.
=============================================
http://lists.squeakfoundation.org/pipermail/packages/2015-May/008219.html
Name: Morphic-kfr.958
Ancestors: Morphic-mt.957
Couple of layout and color fixes to NewColorPickerMorph
=============================================
http://lists.squeakfoundation.org/pipermail/packages/2015-May/008220.html
Name: Morphic-kfr.959
Ancestors: Morphic-kfr.958
Added back drop shadow preference
=============================================
2015-05-02 18:27 GMT+02:00 <commits(a)source.squeak.org>:
> A new version of Kernel was added to project The Inbox:
> http://source.squeak.org/inbox/Kernel-mtf.924.mcz
>
> ==================== Summary ====================
>
> Name: Kernel-mtf.924
> Author: mtf
> Time: 2 May 2015, 12:26:05.675 pm
> UUID: 7f688860-5202-4c0d-8ece-8723fe7317d6
> Ancestors: Kernel-nice.923
>
> Copied Number >> #round: from Pharo. One of 3 methods needed to make the
> Artefact pdf library work on squeak:
> https://sites.google.com/site/artefactpdf/
>
> =============== Diff against Kernel-nice.923 ===============
>
> Item was added:
> + ----- Method: Float>>round: (in category 'truncation and round off')
> -----
> + round: numberOfWishedDecimal
> + "only leave a fixed amount of decimal"
> + "10.12345 round: 2 => 10.12"
> +
> + | v |
> + v := 10 raisedTo: numberOfWishedDecimal.
> + ^ ((self * v) rounded / v) asFloat
> + !
>
>
self assert: (Float fmax round: 2) = Float fmax.
It's probably not very important for artefact, but if this method has a
wider usage than artefact, then it should better be robust to overflow...
> Item was added:
> + ----- Method: Fraction>>round: (in category 'truncation and round off')
> -----
> + round: numberOfWishedDecimal
> + ^self asFloat round: numberOfWishedDecimal!
>
>
Transforming exact arithmetic into inexact Float sounds like heresy to me ;)
That's a questionable choice.
Why this cult to Float would be necessary here?
> Item was added:
> + ----- Method: Integer>>round: (in category 'truncation and round off')
> -----
> + round: numberOfWishedDecimal
> + ^self!
>
> Item was added:
> + ----- Method: Number>>round: (in category 'truncation and round off')
> -----
> + round: numberOfWishedDecimal
> + self subclassResponsibility!
>
>
> If it's subclass responsibility, then it must be implemented in
ScaledDecimal.
This is not necessary in Pharo, because ScaledDecimal has been moved under
Fraction, but it is in Squeak.
I'd rather see Float implementation moved up (without the asFloat) and
Float invoking super asFloat...
I didn't check artefact, but I suspect that the usage is just to
printShowingMaxDecimals: numberOfWishedDecimal, which would make the whole
method moot.
Nicolas
I know you are making the Smalltalk code behave teh same as the
primitive but did you consider making the primitive behave the same as
the Smalltalk code and signal an error?
I dunno, if an app is going to calculate a starting position to search
a String and gets it wrong, this code will quietly produce erroneous
results. Such is the type of bug that could go unnoticed for a long
time. This seems like one of those things that is low-level enough
that an error should be signaled..
On Fri, May 1, 2015 at 4:06 AM, <commits(a)source.squeak.org> wrote:
> Tim Felgentreff uploaded a new version of Collections to project The Trunk:
> http://source.squeak.org/trunk/Collections-tfel.623.mcz
>
> ==================== Summary ====================
>
> Name: Collections-tfel.623
> Author: tfel
> Time: 1 May 2015, 11:06:35.625 am
> UUID: baf2902d-52b9-2442-a513-8a5a6ff0ce30
> Ancestors: Collections-nice.622
>
> fix fallback code for ByteString>>findSubstring:in:startingAt:matchTable: when passing a starting index <= 0
>
> =============== Diff against Collections-nice.622 ===============
>
> Item was changed:
> ----- Method: ByteString>>findSubstring:in:startingAt:matchTable: (in category 'comparing') -----
> findSubstring: key in: body startingAt: start matchTable: matchTable
> "Answer the index in the string body at which the substring key first occurs, at or beyond start. The match is determined using matchTable, which can be used to effect, eg, case-insensitive matches. If no match is found, zero will be returned.
>
> The algorithm below is not optimum -- it is intended to be translated to C which will go so fast that it wont matter."
> | index |
> <primitive: 'primitiveFindSubstring' module: 'MiscPrimitivePlugin'>
> <var: #key declareC: 'unsigned char *key'>
> <var: #body declareC: 'unsigned char *body'>
> <var: #matchTable declareC: 'unsigned char *matchTable'>
>
> key size = 0 ifTrue: [^ 0].
> + (start max: 1) to: body size - key size + 1 do:
> - start to: body size - key size + 1 do:
> [:startIndex |
> index := 1.
> [(matchTable at: (body at: startIndex+index-1) asciiValue + 1)
> = (matchTable at: (key at: index) asciiValue + 1)]
> whileTrue:
> [index = key size ifTrue: [^ startIndex].
> index := index+1]].
> ^ 0
> "
> ' ' findSubstring: 'abc' in: 'abcdefabcd' startingAt: 1 matchTable: CaseSensitiveOrder 1
> ' ' findSubstring: 'abc' in: 'abcdefabcd' startingAt: 2 matchTable: CaseSensitiveOrder 7
> ' ' findSubstring: 'abc' in: 'abcdefabcd' startingAt: 8 matchTable: CaseSensitiveOrder 0
> ' ' findSubstring: 'abc' in: 'abcdefABcd' startingAt: 2 matchTable: CaseSensitiveOrder 0
> ' ' findSubstring: 'abc' in: 'abcdefABcd' startingAt: 2 matchTable: CaseInsensitiveOrder 7
> "!
>
>
A new version of Kernel was added to project The Inbox:
http://source.squeak.org/inbox/Kernel-mtf.924.mcz
==================== Summary ====================
Name: Kernel-mtf.924
Author: mtf
Time: 2 May 2015, 12:26:05.675 pm
UUID: 7f688860-5202-4c0d-8ece-8723fe7317d6
Ancestors: Kernel-nice.923
Copied Number >> #round: from Pharo. One of 3 methods needed to make the Artefact pdf library work on squeak: https://sites.google.com/site/artefactpdf/
=============== Diff against Kernel-nice.923 ===============
Item was added:
+ ----- Method: Float>>round: (in category 'truncation and round off') -----
+ round: numberOfWishedDecimal
+ "only leave a fixed amount of decimal"
+ "10.12345 round: 2 => 10.12"
+
+ | v |
+ v := 10 raisedTo: numberOfWishedDecimal.
+ ^ ((self * v) rounded / v) asFloat
+ !
Item was added:
+ ----- Method: Fraction>>round: (in category 'truncation and round off') -----
+ round: numberOfWishedDecimal
+ ^self asFloat round: numberOfWishedDecimal!
Item was added:
+ ----- Method: Integer>>round: (in category 'truncation and round off') -----
+ round: numberOfWishedDecimal
+ ^self!
Item was added:
+ ----- Method: Number>>round: (in category 'truncation and round off') -----
+ round: numberOfWishedDecimal
+ self subclassResponsibility!