Nicolas Cellier uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-nice.378.mcz
==================== Summary ====================
Name: KernelTests-nice.378
Author: nice
Time: 25 April 2020, 3:19:51.367541 pm
UUID: c233a5e2-d02d-4010-a59a-441c4e1f9c25
Ancestors: KernelTests-eem.377
Assert that we can use once more than once.
#once is using startpc as a key to register the value of first evaluation.
This works well for old block closure whose bytecode lie in homeMethod at different startpc.
But the startpc of FullBlockClosure might all be equal...
So it's far from obvious that once is going to work for Full blocks.
But #once is using startpc the inst.var. rather than #startpc the message send.
And the startpc inst. var. contains the CompiledBlock which is misleading.
Since I've been bitten more than once, I prefer to document it.
There is a little flaw though: two equal blocks will register at same key...
Maybe there's no real use case, but we might want to use an IdentityDictionary as cache.
=============== Diff against KernelTests-eem.377 ===============
Item was added:
+ ----- Method: BlockClosureTest>>testMoreThanOnce (in category 'tests - evaluating') -----
+ testMoreThanOnce
+ "Make sure that we can use once more than once"
+ | moreThanOnce |
+ moreThanOnce := (1 to: 3) collect: [:e | [String new] once -> [Array new] once].
+ self assert: (moreThanOnce allSatisfy: [:each | each key isString]).
+ self assert: (moreThanOnce allSatisfy: [:each | each value isArray]).
+ self assert: (moreThanOnce allSatisfy: [:each | each key == moreThanOnce first key]).
+ self assert: (moreThanOnce allSatisfy: [:each | each value == moreThanOnce first value]).!
Item was added:
+ ----- Method: BlockClosureTest>>testMoreThanOnceForEqualBlocks (in category 'tests - evaluating') -----
+ testMoreThanOnceForEqualBlocks
+ "Make sure that we can use once more than once"
+ | moreThanOnce |
+ moreThanOnce := (1 to: 3) collect: [:e | [Object new] once -> [Object new] once].
+ self assert: (moreThanOnce allSatisfy: [:each | each key == moreThanOnce first key]).
+ self assert: (moreThanOnce allSatisfy: [:each | each value == moreThanOnce first value]).
+ self assert: (moreThanOnce noneSatisfy: [:each | each key == each value]).!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1648.mcz
==================== Summary ====================
Name: Morphic-mt.1648
Author: mt
Time: 20 April 2020, 6:45:09.736142 pm
UUID: 5665e297-144e-5644-9799-492dcdef4e32
Ancestors: Morphic-mt.1647
Fixes some visual glitches that happened when using the text morph's public interface to change text selection. Note that this selection interface transcends from the inner text editor, through the text morph, up to the pluggable text morph. Yay.
=============== Diff against Morphic-mt.1647 ===============
Item was changed:
----- Method: PluggableTextMorph>>mouseLeave: (in category 'event handling') -----
mouseLeave: event
"Save the selection interval for later."
+ self rememberSelectionInterval.
- self flag: #fixIntervalCache. "mt: We should find a better design for discarding unused text editors in text morphs and restoring them on demand."
- selectionInterval := textMorph editor markIndex to: textMorph editor pointIndex -1.
super mouseLeave: event.
Preferences mouseOverForKeyboardFocus
ifTrue: [event hand releaseKeyboardFocus: self]!
Item was added:
+ ----- Method: PluggableTextMorph>>rememberSelectionInterval (in category 'private') -----
+ rememberSelectionInterval
+
+ self flag: #fixIntervalCache. "mt: We should find a better design for discarding unused text editors in text morphs and restoring them on demand."
+ selectionInterval := textMorph editor markIndex to: textMorph editor pointIndex - 1.!
Item was changed:
----- Method: PluggableTextMorph>>scrollSelectionIntoView: (in category 'editor access') -----
scrollSelectionIntoView: event
"Scroll my text into view. Due to line composition mechanism, we must never use the right of a character block because the lines last character block right value always comes from a global container and is *not* line specific."
+ self rememberSelectionInterval.
- self flag: #fixIntervalCache. "mt: We should find a better design for discarding unused text editors in text morphs and restoring them on demand."
- selectionInterval := textMorph editor markIndex to: textMorph editor pointIndex - 1.
textMorph editor hasSelection
ifFalse: [self scrollToShow: (textMorph editor startBlock withWidth: 1)]
ifTrue: [
self scrollToShow: (textMorph editor startBlock topLeft corner: textMorph editor stopBlock bottomLeft).
self scrollToShow: (textMorph editor pointBlock withWidth: 1). "Ensure text cursor visibility."].
^ true!
Item was changed:
----- Method: PluggableTextMorph>>selectAll (in category 'editor access') -----
selectAll
- "Tell my textMorph to select all"
+ textMorph selectAll.
+ self rememberSelectionInterval.!
- textMorph selectAll.!
Item was changed:
----- Method: PluggableTextMorph>>selectFrom:to: (in category 'interactive error protocol') -----
selectFrom: start to: stop
+
+ textMorph selectFrom: start to: stop.
+ self rememberSelectionInterval.!
- ^ textMorph editor selectFrom: start to: stop!
Item was added:
+ ----- Method: PluggableTextMorph>>selectInterval: (in category 'editor access') -----
+ selectInterval: anInterval
+
+ textMorph selectInterval: anInterval.
+ self rememberSelectionInterval.!
Item was changed:
----- Method: PluggableTextMorph>>selectionInterval (in category 'editor access') -----
selectionInterval
+
+ ^ textMorph selectionInterval!
- ^ textMorph editor selectionInterval!
Item was changed:
----- Method: PluggableTextMorph>>selectionInterval: (in category 'editor access') -----
+ selectionInterval: anInterval
+
+ textMorph selectionInterval: anInterval.
+ self rememberSelectionInterval.!
- selectionInterval: sel
- textMorph editor selectInterval: sel.!
Item was changed:
----- Method: TextMorph>>selectFrom:to: (in category 'accessing') -----
+ selectFrom: start to: stop
+
+ self selectionChanged.
+ self editor selectFrom: start to: stop.
+ self selectionChanged.
+ !
- selectFrom: a to: b
- self editor selectFrom: a to: b!
Item was added:
+ ----- Method: TextMorph>>selectInterval: (in category 'accessing') -----
+ selectInterval: anInterval
+
+ self selectionChanged.
+ self editor selectInterval: anInterval.
+ self selectionChanged.
+ !
Item was added:
+ ----- Method: TextMorph>>selectionInterval (in category 'accessing') -----
+ selectionInterval
+
+ ^ self editor selectionInterval!
Item was added:
+ ----- Method: TextMorph>>selectionInterval: (in category 'accessing') -----
+ selectionInterval: anInterval
+
+ self selectInterval: anInterval.!
Eliot Miranda uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-eem.1154.mcz
==================== Summary ====================
Name: System-eem.1154
Author: eem
Time: 19 January 586155, 1:08:16.564616 am
UUID: 774a2409-d212-1a47-8988-0250ab5f13d2
Ancestors: System-mt.1153
Spelling in a class comment
=============== Diff against System-mt.1153 ===============
Item was changed:
Object subclass: #AbstractLauncher
instanceVariableNames: 'parameters'
classVariableNames: ''
poolDictionaries: ''
category: 'System-Support'!
+ !AbstractLauncher commentStamp: 'eem 1/19/586155 01:04' prior: 0!
+ The class AutoStart in combination with the Launcher classes provides a mechanism for starting Squeak from the command line or a web page. Parameters on the command line or in the embed tag in the web page a parsed and stored in the launcher's parameter dictionary.
- !AbstractLauncher commentStamp: 'mt 8/14/2016 10:08' prior: 0!
- The class AutoStart in combination with the Launcher classes provides a mechanism for starting Squeak from the command line or a web page. Parameters on the command line or in the embed tag in the web page a parsed and stored in the lauchner's parameter dictionary.
Subclasses can access these parameters to determine what to do.
CommandLineLauncherExample provides an example for a command line application. if you start squeak with a command line 'class Integer' it will launch a class browser on class Integer.
To enable this execute
CommandLineLauncherExample activate
before you save the image.
To disable execute
CommandLineLauncherExample deactivate
The PluginLauncher is an example how to use this framework to start Squeak as a browser plugin. It looks for a parameter 'src' which should point to a file containing a squeak script.!