A new version of Installer-Core was added to project The Inbox:
http://source.squeak.org/inbox/Installer-Core-cmm.389.mcz
==================== Summary ====================
Name: Installer-Core-cmm.389
Author: cmm
Time: 2 January 2014, 11:06:37.4 am
UUID: 1bf23881-299e-4af3-a520-01997ffa1344
Ancestors: Installer-Core-tpr.388
Remove the rest of the #remembered infrastructure since Tim removed #rememberAs:.
=============== Diff against Installer-Core-tpr.388 ===============
Item was changed:
Object subclass: #Installer
instanceVariableNames: 'answers packages messagesToSuppress useFileIn noiseLevel currentRepository'
+ classVariableNames: 'InstallerBindings IsSetToTrapErrors Repositories SkipLoadingTests ValidationBlock'
- classVariableNames: 'InstallerBindings IsSetToTrapErrors Remembered Repositories SkipLoadingTests ValidationBlock'
poolDictionaries: ''
category: 'Installer-Core'!
!Installer commentStamp: 'kph 3/30/2009 01:29' prior: 0!
Documentation now available at http://installer.pbwiki.com/Installer
useFileIn - flag to load source.st rather than using Monticello!
Item was removed:
- ----- Method: Installer class>>doesNotUnderstand: (in category 'custom names') -----
- doesNotUnderstand: aMessage
- ^ self remembered at: aMessage selector ifAbsent: [ super doesNotUnderstand: aMessage ]!
Item was removed:
- ----- Method: Installer class>>remembered (in category 'custom names') -----
- remembered
- self isThisEverCalled: 'clean the var too.'.
- ^ Remembered ifNil: [ Remembered := IdentityDictionary new ]!
On 31 December 2013 22:27, <commits(a)source.squeak.org> wrote:
> A new version of ReleaseBuilder was added to project The Inbox:
> http://source.squeak.org/inbox/ReleaseBuilder-cmm.105.mcz
>
> ==================== Summary ====================
>
> Name: ReleaseBuilder-cmm.105
> Author: cmm
> Time: 31 December 2013, 4:27:44.493 pm
> UUID: 0bae46e0-1d72-49c3-830c-5dc2fa2b4958
> Ancestors: ReleaseBuilder-cmm.104
>
> Please let all internal image work and modifications for building our releases be delegated to ReleaseBuilder.
>
> =============== Diff against ReleaseBuilder-cmm.104 ===============
>
> Item was changed:
> ----- Method: ReleaseBuilder class>>prepareNewBuild: (in category 'scripts') -----
> prepareNewBuild: anMCRepository
> "ReleaseBuilderTrunk prepareNewBuild"
> "Prepare everything that should be done for a new image build"
> + MCMcmUpdater updateMissingPackages: true.
> + MCMcmUpdater enableUpdatesForAllPackages.
> + Workspace allInstances do: [ : each | each topView delete].
Duly removed from squeak-ci's release.st.
> + MorphicProject initialize.
Why? I guess to set the background from MorphicProject class >>
#defaultBackgroundForm. Why store an image in a string inside the
image? It looks like you're jumping through hoops just to avoid
touching anything outside the image.
(release.st pulls in the image from the squeak-ci repository. The
image is currently this guy -
https://github.com/squeak-smalltalk/squeak-ci/blob/de815b8722284e8095c0ed35…)
frank
On 1 January 2014 18:41, <commits(a)source.squeak.org> wrote:
> A new version of Tests was added to project The Inbox:
> http://source.squeak.org/inbox/Tests-cwp.281.mcz
>
> ==================== Summary ====================
>
> Name: Tests-cwp.281
> Author: cwp
> Time: 1 January 2014, 1:21:21.324 pm
> UUID: bd0290d9-b157-4355-8e18-8dd4f4705e23
> Ancestors: Tests-fbs.280, Tests-cwp.280
>
> merge
>
> =============== Diff against Tests-fbs.280 ===============
>
> Item was added:
> + ----- Method: AliasTest>>testSource (in category 'tests') -----
> + testSource
> + | alias source |
> + source := #Griffle => value.
> + alias := source asBinding: #Plonk.
> + self assert: alias source == source!
>
> Item was changed:
> TestCase subclass: #BindingPolicyTest
> + instanceVariableNames: 'environment policy value notified notifiedBinding'
> - instanceVariableNames: 'namespace policy value'
> classVariableNames: ''
> poolDictionaries: ''
> category: 'Tests-Environments'!
>
> Item was removed:
> - ----- Method: BindingPolicyTest class>>isAbstract (in category 'as yet unclassified') -----
> - isAbstract
> - ^ self name = #BindingPolicyTest!
>
> Item was added:
> + ----- Method: BindingPolicyTest>>addBinding: (in category 'emulating') -----
> + addBinding: aBinding
> + notified := #add.
> + notifiedBinding := aBinding!
>
> Item was added:
> + ----- Method: BindingPolicyTest>>bindingPolicyWithNamePolicy: (in category 'tests') -----
> + bindingPolicyWithNamePolicy: aPolicy
> + ^ BindingPolicy
> + environment: environment
> + policy: aPolicy
> + addSelector: #addBinding:
> + removeSelector: #removeBinding:!
>
> Item was added:
> + ----- Method: BindingPolicyTest>>removeBinding: (in category 'emulating') -----
> + removeBinding: aBinding
> + notified := #remove.
> + notifiedBinding := aBinding!
>
> Item was changed:
> ----- Method: BindingPolicyTest>>setUp (in category 'running') -----
> setUp
> + environment := Environment withName: #test.
> - namespace := IdentityDictionary new.
> value := Object new!
>
> Item was added:
> + ----- Method: BindingPolicyTest>>tearDown (in category 'running') -----
> + tearDown
> + environment destroy.
> + environment := nil.
> + value := nil.!
>
> Item was added:
> + ----- Method: BindingPolicyTest>>testAddHonorsEnvironment (in category 'tests') -----
> + testAddHonorsEnvironment
> + | binding other |
> + other := Environment withName: #other.
> + policy := self bindingPolicyWithNamePolicy: AllNamePolicy new.
> + binding := #Griffle => value.
> + policy binding: binding addedTo: other notify: self.
> + self assert: notified = nil!
I think I've established my reputation as a loud lover of
#assert:equals: :) Just sayin'.
What I often do is set these kinds of variables - variables that show
that some side effect took place - to some obviously wrong value. In
this case, you could set notifier := #notCalled in the #setUp.
I can't figure out what this test _does_ though: when you say that add
honours Environment, you mean that it only adds the binding if the
addedTo: environment matches the policy's environment, and we know
this because the notifier isn't called?
> Item was added:
> + ----- Method: BindingPolicyTest>>testRemoveHonorsEnvironment (in category 'tests') -----
> + testRemoveHonorsEnvironment
> + | binding other |
> + other := Environment withName: #other.
> + policy := self bindingPolicyWithNamePolicy: AllNamePolicy new.
> + binding := #Griffle => value.
> + policy binding: binding removedFrom: other notify: self.
> + self assert: notified = nil!
Same thing as #testAddHonorsEnvironment?
> Item was changed:
> ----- Method: EnvironmentTest>>testImportAddingPrefixResolvesUndeclared (in category 'import tests') -----
> testImportAddingPrefixResolvesUndeclared
> | binding foreign |
> foreign := Environment withName: #Foreign.
> foreign exportSelf.
> + foreign bind: #Griffle to: value.
> + binding := env undeclare: #XXGriffle.
I like this. Nice & explicit language.
> Item was changed:
> ----- Method: EnvironmentTest>>testImportAliases (in category 'import tests') -----
> testImportAliases
> | foreign v2 v3 |
> foreign := Environment withName: #Foreign.
> foreign exportSelf.
> foreign at: #Griffle put: value.
> foreign at: #Nurp put: (v2 := Object new).
> foreign at: #Ziffy put: (v3 := Object new).
Shouldn't these be #bind:to: now?
> + env from: foreign import: {#Nurp -> #Plonk. #Ziffy -> #Wiffy}.
> - env from: foreign import: {#Plonk -> #Nurp. #Wiffy -> #Ziffy}.
I find this hard to understand. So the Array of Associations looks
like it says "when you see Ziffy, interpret that as if you saw Wiffy",
or "map Ziffy to Wiffy". Oh. It says "when you import foreign, map
foreign's Ziffy to env's (new) Wiffy. OK, that makes sense.
> self assert: (env bindingOf: #Griffle) isNil.
> self assert: (env bindingOf: #Plonk) value == v2.
> self assert: (env bindingOf: #Wiffy) value == v3!
> Item was changed:
> ----- Method: EnvironmentTest>>testImportWritable (in category 'import tests') -----
> testImportWritable
> | foreign binding |
> foreign := Environment withName: #Foreign.
> foreign exportSelf.
> + foreign bind: #Griffle to: 'v1'.
> + env from: foreign import: #Griffle -> #Plonk.
> - foreign at: #Griffle put: 'v1'.
> - env from: foreign import: #Plonk -> #Griffle.
> binding := env bindingOf: #Plonk.
> binding value: 'v2'.
> + self assert: (foreign declarationOf: #Griffle) value = 'v2' !
> - self assert: (foreign bindingOf: #Griffle) value == 'v2' !
I realise this is existing behaviour, but I'm not so keen on
sub-environments being able to tinker with parent environments'
bindings. What's the use case here? It means an Environment can't be
used as a sandbox.
> Item was added:
> + ----- Method: EnvironmentTest>>testUndeclare (in category 'binding tests') -----
> + testUndeclare
> + | one two |
> + one := env undeclare: #Griffle.
> + two := env bindingOf: #Griffle.
> + self assert: one == two.
> + self assert: one class == Global!
Ah. This shows that you can always add new undeclared stuff to an
environment. The name of the test didn't tell me that :/. Also, is it
part of the API that one value isNil?
> Item was added:
> + ----- Method: EnvironmentTest>>testUndeclaredBecomeClassBinding (in category 'compatibility tests') -----
> + testUndeclaredBecomeClassBinding
> + | binding class |
> + class := Behavior new.
> + binding := env undeclared
> + add: (#Griffle => nil);
> + associationAt: #Griffle.
> + env at: #Griffle put: class.
> + self assert: (binding class == ClassBinding).
> + self assert: binding value == class.!
>
> Item was added:
> + ----- Method: EnvironmentTest>>testUndeclaredBecomesGlobal (in category 'compatibility tests') -----
> + testUndeclaredBecomesGlobal
> + | binding class |
> + class := Behavior new.
> + binding := env undeclared
> + add: (#Griffle => class);
> + associationAt: #Griffle.
> + env bind: #Griffle to: value.
> + self assert: (binding class == Global).
> + self assert: binding value == value.!
Minor nit: one of these tests says "BecomeSomething" and the other
says "BecomesSomething".
> Item was changed:
> + ----- Method: MCClassDefinitionTest>>testLoadAndUnload (in category 'as yet unclassified') -----
So all this noise in the Monticello tests is because there are two
Tests-fbs.280 - one in trunk, and one in the inbox. Fun times. The one
in the inbox changes the MC tests to load definitions into an
Environment that's then thrown away after the test runs. This avoids
MC mucking around with global state.
The changes have been sitting in the Inbox for a week, but given
Colin's big chunk of stuff landing in the Inbox, let's review it, push
to trunk when ready, and then I'll update my MC test hacking, and
resubmit.
frank
Nicolas Cellier uploaded a new version of Graphics to project The Inbox:
http://source.squeak.org/inbox/Graphics-nice.285.mcz
==================== Summary ====================
Name: Graphics-nice.285
Author: nice
Time: 1 January 2014, 8:53:32.416 pm
UUID: 04aee02d-83ae-4b4d-aed9-968a6a7487db
Ancestors: Graphics-nice.284
Change Color implementation from 10 bits per (rgb) component to 8 bits per component.
Several considerations motivate this change:
- no Graphic output is using 10 bits;
- alpha channel is already stored using 8 bits;
- 8 bits matches nowadays most used 32 bits depth Form - thus it's an optimization.
Note that the tolerance for testing Color components has to be increased to a value >= (1/255), I suggest 0.005.
=============== Diff against Graphics-nice.284 ===============
Item was added:
+ (PackageInfo named: 'Graphics') preamble: '"Change color components from 10 to 8 bits"
+ Color allSubInstancesDo:
+ [:c |
+ | rgb |
+ rgb := c instVarNamed: ''rgb''.
+ rgb := (rgb bitAnd: 16r3FC00000) >> 2 + (rgb bitAnd: 16rFF000) >> 2 + (rgb bitAnd: 16r3FC) >> 2.
+ c instVarNamed: ''rgb'' put: rgb; flushCache].'!
Item was changed:
----- Method: Color class>>initialize (in category 'class initialization') -----
initialize
"Color initialize"
"Details: Externally, the red, green, and blue components of color
are floats in the range [0.0..1.0]. Internally, they are represented
as integers in the range [0..ComponentMask] packing into a
small integer to save space and to allow fast hashing and
equality testing.
For a general description of color representations for computer
graphics, including the relationship between the RGB and HSV
color models used here, see Chapter 17 of Foley and van Dam,
Fundamentals of Interactive Computer Graphics, Addison-Wesley,
1982."
+ ComponentMask := 255.
+ HalfComponentMask := 128. "used to round up in integer calculations"
+ ComponentMax := 255.0. "a Float used to normalize components"
+ RedShift := 16.
+ GreenShift := 8.
- ComponentMask := 1023.
- HalfComponentMask := 512. "used to round up in integer calculations"
- ComponentMax := 1023.0. "a Float used to normalize components"
- RedShift := 20.
- GreenShift := 10.
BlueShift := 0.
PureRed := self r: 1 g: 0 b: 0.
PureGreen := self r: 0 g: 1 b: 0.
PureBlue := self r: 0 g: 0 b: 1.
PureYellow := self r: 1 g: 1 b: 0.
PureCyan := self r: 0 g: 1 b: 1.
PureMagenta := self r: 1 g: 0 b: 1.
RandomStream := Random new.
self initializeIndexedColors.
self initializeGrayToIndexMap.
self initializeNames.
self initializeHighLights.
!
Item was changed:
----- Method: Color class>>initializeGrayToIndexMap (in category 'class initialization') -----
initializeGrayToIndexMap
"Build an array of gray values available in the 8-bit colormap. This array is indexed by a gray level between black (1) and white (256) and returns the pixel value for the corresponding gray level."
"Note: This method must be called after initializeIndexedColors, since it uses IndexedColors."
"Color initializeGrayToIndexMap"
| grayLevels grayIndices c distToClosest dist indexOfClosest |
"record the level and index of each gray in the 8-bit color table"
grayLevels := OrderedCollection new.
grayIndices := OrderedCollection new.
"Note: skip the first entry, which is reserved for transparent"
2 to: IndexedColors size do: [:i |
c := IndexedColors at: i.
c saturation = 0.0 ifTrue: [ "c is a gray"
+ grayLevels add: c privateBlue. "top 8 bits; R, G, and B are the same"
- grayLevels add: (c privateBlue) >> 2. "top 8 bits; R, G, and B are the same"
grayIndices add: i - 1]]. "pixel values are zero-based"
grayLevels := grayLevels asArray.
grayIndices := grayIndices asArray.
"for each gray level in [0..255], select the closest match"
GrayToIndexMap := ByteArray new: 256.
0 to: 255 do: [:level |
distToClosest := 10000. "greater than distance to any real gray"
1 to: grayLevels size do: [:i |
dist := (level - (grayLevels at: i)) abs.
dist < distToClosest ifTrue: [
distToClosest := dist.
indexOfClosest := grayIndices at: i]].
GrayToIndexMap at: (level + 1) put: indexOfClosest].
!
Item was changed:
----- Method: Color>>asHTMLColor (in category 'conversions') -----
asHTMLColor
+ ^'#' , (rgb printStringBase: 16 length: 6 padded: true)!
- | s |
- s := '#000000' copy.
- s at: 2 put: (Character digitValue: ((rgb bitShift: -6 - RedShift) bitAnd: 15)).
- s at: 3 put: (Character digitValue: ((rgb bitShift: -2 - RedShift) bitAnd: 15)).
- s at: 4 put: (Character digitValue: ((rgb bitShift: -6 - GreenShift) bitAnd: 15)).
- s at: 5 put: (Character digitValue: ((rgb bitShift: -2 - GreenShift) bitAnd: 15)).
- s at: 6 put: (Character digitValue: ((rgb bitShift: -6 - BlueShift) bitAnd: 15)).
- s at: 7 put: (Character digitValue: ((rgb bitShift: -2 - BlueShift) bitAnd: 15)).
- ^ s!
Item was changed:
----- Method: Color>>closestPixelValue1 (in category 'conversions') -----
closestPixelValue1
"Return the nearest approximation to this color for a monochrome Form."
"fast special cases"
rgb = 0 ifTrue: [^ 1]. "black"
+ rgb = 16rFFFFFFF ifTrue: [^ 0]. "white"
- rgb = 16r3FFFFFFF ifTrue: [^ 0]. "white"
self luminance > 0.5
ifTrue: [^ 0] "white"
ifFalse: [^ 1]. "black"
!
Item was changed:
----- Method: Color>>closestPixelValue2 (in category 'conversions') -----
closestPixelValue2
"Return the nearest approximation to this color for a 2-bit deep Form."
| lum |
"fast special cases"
rgb = 0 ifTrue: [^ 1]. "black"
+ rgb = 16rFFFFFFF ifTrue: [^ 2]. "opaque white"
- rgb = 16r3FFFFFFF ifTrue: [^ 2]. "opaque white"
lum := self luminance.
lum < 0.2 ifTrue: [^ 1]. "black"
lum > 0.6 ifTrue: [^ 2]. "opaque white"
^ 3 "50% gray"
!
Item was changed:
----- Method: Color>>closestPixelValue4 (in category 'conversions') -----
closestPixelValue4
"Return the nearest approximation to this color for a 4-bit deep Form."
| bIndex |
"fast special cases"
rgb = 0 ifTrue: [^ 1]. "black"
+ rgb = 16rFFFFFFF ifTrue: [^ 2]. "opaque white"
- rgb = 16r3FFFFFFF ifTrue: [^ 2]. "opaque white"
rgb = PureRed privateRGB ifTrue: [^ 4].
rgb = PureGreen privateRGB ifTrue: [^ 5].
rgb = PureBlue privateRGB ifTrue: [^ 6].
rgb = PureCyan privateRGB ifTrue: [^ 7].
rgb = PureYellow privateRGB ifTrue: [^ 8].
rgb = PureMagenta privateRGB ifTrue: [^ 9].
bIndex := (self luminance * 8.0) rounded. "bIndex in [0..8]"
^ #(
1 "black"
10 "1/8 gray"
11 "2/8 gray"
12 "3/8 gray"
3 "4/8 gray"
13 "5/8 gray"
14 "6/8 gray"
15 "7/8 gray"
2 "opaque white"
) at: bIndex + 1.
!
Item was changed:
----- Method: Color>>closestPixelValue8 (in category 'conversions') -----
closestPixelValue8
"Return the nearest approximation to this color for an 8-bit deep Form."
"fast special cases"
rgb = 0 ifTrue: [^ 1]. "black"
+ rgb = 16rFFFFFFF ifTrue: [^ 255]. "white"
- rgb = 16r3FFFFFFF ifTrue: [^ 255]. "white"
self saturation < 0.2 ifTrue: [
+ ^ GrayToIndexMap at: self privateGreen + 1. "nearest gray"
- ^ GrayToIndexMap at: (self privateGreen >> 2) + 1. "nearest gray"
] ifFalse: [
"compute nearest entry in the color cube"
^ 40 +
((((self privateRed * 5) + HalfComponentMask) // ComponentMask) * 36) +
((((self privateBlue * 5) + HalfComponentMask) // ComponentMask) * 6) +
(((self privateGreen * 5) + HalfComponentMask) // ComponentMask)].
!
Item was changed:
----- Method: Color>>pixelValueForDepth: (in category 'conversions') -----
pixelValueForDepth: d
"Returns an integer representing the bits that appear in a single pixel of this color in a Form of the given depth. The depth must be one of 1, 2, 4, 8, 16, or 32. Contrast with pixelWordForDepth: and bitPatternForDepth:, which return either a 32-bit word packed with the given pixel value or a multiple-word Bitmap containing a pattern. The inverse is the class message colorFromPixelValue:depth:"
"Details: For depths of 8 or less, the result is a colorMap index. For depths of 16 and 32, it is a direct color value with 5 or 8 bits per color component."
"Transparency: The pixel value zero is reserved for transparent. For depths greater than 8, black maps to the darkest possible blue."
| val |
d > 8 "most common case"
ifTrue:
[d = 32 ifTrue: [
"eight bits per component; top 8 bits set to all ones (opaque alpha)"
+ ^rgb = 0 ifTrue: [16rFF000001] ifFalse: [rgb bitOr: 16rFF000000]].
- val := (LargePositiveInteger new: 4)
- at: 4 put: 16rFF;
- at: 3 put: ((rgb bitShift: -22) bitAnd: 16rFF);
- at: 2 put: ((rgb bitShift: -12) bitAnd: 16rFF);
- at: 1 put: ((rgb bitShift: -2) bitAnd: 16rFF);
- normalize. "normalize is not necessary as long as SmallInteger maxVal highBit < 32, but let's be future proof"
- ^val < 16rFF000001 ifTrue: [16rFF000001] ifFalse: [val]].
d = 16 ifTrue: [
"five bits per component; top bits ignored"
+ val := (((rgb bitShift: -9) bitAnd: 16r7C00) bitOr:
+ ((rgb bitShift: -6) bitAnd: 16r03E0)) bitOr:
+ ((rgb bitShift: -3) bitAnd: 16r001F).
- val := (((rgb bitShift: -15) bitAnd: 16r7C00) bitOr:
- ((rgb bitShift: -10) bitAnd: 16r03E0)) bitOr:
- ((rgb bitShift: -5) bitAnd: 16r001F).
^val < 1 ifTrue: [1] ifFalse: [val]].
d = 12 ifTrue: [ "for indexing a color map with 4 bits per color component"
+ val := (((rgb bitShift: -12) bitAnd: 16r0F00) bitOr:
+ ((rgb bitShift: -8) bitAnd: 16r00F0)) bitOr:
+ ((rgb bitShift: -4) bitAnd: 16r000F).
- val := (((rgb bitShift: -18) bitAnd: 16r0F00) bitOr:
- ((rgb bitShift: -12) bitAnd: 16r00F0)) bitOr:
- ((rgb bitShift: -6) bitAnd: 16r000F).
^val < 1 ifTrue: [1] ifFalse: [val]].
d = 9 ifTrue: [ "for indexing a color map with 3 bits per color component"
+ val := (((rgb bitShift: -15) bitAnd: 16r01C0) bitOr:
+ ((rgb bitShift: -10) bitAnd: 16r0038)) bitOr:
+ ((rgb bitShift: -5) bitAnd: 16r0007).
- val := (((rgb bitShift: -21) bitAnd: 16r01C0) bitOr:
- ((rgb bitShift: -14) bitAnd: 16r0038)) bitOr:
- ((rgb bitShift: -7) bitAnd: 16r0007).
^val < 1 ifTrue: [1] ifFalse: [val]]].
d = 8 ifTrue: [^ self closestPixelValue8].
d = 4 ifTrue: [^ self closestPixelValue4].
d = 2 ifTrue: [^ self closestPixelValue2]..
d = 1 ifTrue: [^ self closestPixelValue1].
self error: 'unknown pixel depth: ', d printString
!
Item was added:
+ (PackageInfo named: 'Graphics') postscript: '"The cache might hold incorrect values during 10->8 bits per component transition"
+ Color allSubInstancesDo: [:c | c flushCache].'!
A new version of ShoutCore was added to project The Inbox:
http://source.squeak.org/inbox/ShoutCore-cwp.40.mcz
==================== Summary ====================
Name: ShoutCore-cwp.40
Author: cwp
Time: 1 January 2014, 1:11:46.449 pm
UUID: 81b3e230-2e8a-42c5-9521-e54338fadb6f
Ancestors: ShoutCore-fbs.39
Rewrite environment import/export to be eager, rather than lazy. (step 2 of 3)
=============== Diff against ShoutCore-fbs.39 ===============
Item was changed:
----- Method: Environment>>hasBindingThatBeginsWith: (in category '*ShoutCore') -----
hasBindingThatBeginsWith: aString
+ bindings associationsDo:
- references associationsDo:
[:ea | (ea key beginsWith: aString) ifTrue: [^ true]].
^ false
!