[updates] 36 or so including... MODULES!

Dan Ingalls Dan at SqueakLand.org
Wed Jan 30 07:15:32 UTC 2002


The first dozen updates are mostly cleanups and bug fixes.  Then 4665 introduces modules and gives you a chance to stop there if you're faint of heart or have a critical project due next week. 

Yes, folks, we're finally dragging Squeak, kicking and screaming, into the 21st century.   Having modules in Squeak should finally allow us to embrace more diversity without having to fill the image with redundant and confusing stuff.

Things to do, now that we have modules, include...

1.  I will be issuing a bunch of further updates from the harvesters, so this should flush out any lurking problems with incremental updating.

2.  We need to start the process of decomposing the release image into a clean kernel and a bunch of reasonable modules.

3.  We need to define a module storage format that is reasonably compact, can be loaded reasonably quickly, and includes its own source code browsing mechanism (so that loading and unloading a module does not pollute the .changes file).

4.  Move on to the related goal of modular projects so that loading and unloading a project will leave the host image unchanged.

I want to thank Henrik, especially, for jumping in, and everyone else for a lot of useful discussion.  Now it's time to start using the tool, fix it if it needs fixing, and start cleaning up the image.  Note that Henrik and Stephane are co-chairs of an official SqF project to do exactly this.  In anticipation of a fair amount of traffic on this topic, let's use the [modules] banner for further discussion on this topic.

Onward and upward...

	- Dan

[PS regarding the registering FileList that is part of these updates, almost the first thing I tried revealed that some of that code (putUpdate:, which I fixed) predates #4178 of 6/26/2001, so it would be good if someone can do a quick pass to see if there are any other gotchas involving recent changes to the FileList]
-------------------------
4654dragNDropHandler-mir -- Michael Rueger -- 10 January 2002
Extends the handling of external drop events to also look for file extensions.
Let's you register handlers for types or extension without the need to modify PasteUpMorph.
Look at ExternalDropHandler class default handler messages to see how to use this mechanism."

4655include-sw -- Scott Wallace -- 22 January 2002
As per request via Kim, the wording on the 'append' and 'prepend' tiles is changed to feature the word 'include'"

4656misc-sw -- Scott Wallace -- 22 January 2002
* Removes gratuitous occurrences of '..' from four methods.
* Include a stay-up item in the shifted selector-list menu of a message list.
* Fixes the method SystemDictionary.browseAllUnSentMessages.  This ancient method is slow and often not too useful (because it retrieves > 4000 methods!) but at least it now works again.
* Stop putting up that annoying 'no change made' msg when the user backs out of a rename in a change sorter"

4657someRemovals-sw -- Scott Wallace -- 22 January 2002
Removes fifty disused methods."

4658DataStreamFix-ar -- Andreas Raab -- 25 January 2002
Fixes a problem with DataStream reading in word classes whose size differs from their basicSize."

4659SndPlayerFeeback-ar -- Andreas Raab -- 25 January 2002
Allow feedback from the SoundPlayer to use by other applications (e.g., spectrum analyzers etc)."

4660BBAlphaFix-ar -- Andreas Raab -- 25 January 2002
Fixes a problem in BitBlt when using constant blending mode with 32bpp forms."

4661chatInitFix-raa -- Bob Arning -- 28 January 2002
provide another image for the parts bin to avoid getting the local ip address before the network is initialized (can mess things up)"

4662jpegFrameSorting-jm

4663nilOwnerFix-raa -- Bob Arning -- 29 January 2002
#colorForInsets seems to be called earlier these days. deal with it."

4664transcriptFromFlap-sw -- Scott Wallace -- 29 January 2002
Fixes the bug that a transcript obtained from a Tools flap when not in the top project would not behave properly.  Replaces the errant Tools Flap with one that does not have the bug, provided the user has the preference governing the reinitialization of flaps set to true.  Also fixed is the less-well-known bug that an Objects Tool that was created in one project and then transferred to another via a flap would also deliver up a flawed Transcript.  (Preexisting instances of the Object Tool may however retain the flaw.)"

4665TheModulesAreComing -- Dan Ingalls -- 29 January 2002
Warn the faint of heart about the Module conversion.

4666Modules-1-hg -- Henrik Gedenryd -- 12 September 2001
This is the start for a Module system, based on Dan Ingalls' Environments code. The core is in the category System-Modules, it is rather small.
Note that this is for now a 'weak' module scheme that allows the standard scheme using #Smalltalk to continue working like before.
After filing in all change sets, in the Explorer that opens on the module hierarchy, try:
Module convertSystemOrganizationToModules.
(Note that this is installs 'weak modules' and is irreversible.) Then
	FromVersion0p0000to0001 run
This applies a first set of refactorings of the system, based on a reusable framework for applying (and contributing!) refactorings.
You can also try
Module root declareExternalRefs
Now look at the externalModuleRefs of various modules (use the opened Explorer).
Then try the messages in the ModuleExplorer on different modules. Use exploreIt or printIt to get the results that are returned from them.

4667DeltaModules-hg

4668ServerCode-fixes-hg

4669ExplorerRefactorings-hg

4670ModuleReorgTools-hg -- Henrik Gedenryd -- 3 September 2001
Code and tools for analyzing and reorganizing the system under the modules scheme to remove dependencies. Very much a work in progress."

4671Repositories-hg

4672RecompileFixes-HG

4673SundayFixes-hg

4674preserveAssociations-hg -- Henrik Gedenryd -- 4 December 2001
Some tweaks to preserve associations when moving across dictionaries, when renaming, and so on. Under the hood much of the system depends on preserving the individual Association objects that are used for global (now module) variables."

4675Modules-Compat-hg -- Henrik Gedenryd -- 6 September 2001
Make system compatible with modules, including weak/strong modules.
Preamble has a dirty hack to change instvar name without recompiling 1000+ classes"
Class setInstVarNames: (Class instVarNames copyReplaceAll: #('environment') with: #('module')).

4676Modules-2-hg -- Henrik Gedenryd -- 6 September 2001
Install sensitive methods that rely on others already being in place."

4677ModuleRefactorings2-hg

4678ModulesPostOopsla-hg -- Henrik Gedenryd -- 31 October 2001
This change set contains various changes that have been made since the OOPSLA version at Oct 15. Note that this file was hand-edited."

4679betterModuleScoping1-hg -- Henrik Gedenryd -- 28 November 2001
- Refactors scoping methods from Class to Module.
- Makes class recompilation aware of module name scoping.
- Updates cmd-N to work in a module-aware manner. This will put up multiple windows for a name defined in more than one module.
- Adds ability to set the default/home module of projects.
- Makes the compiler use this home module for name lookups instead of UndefinedObject, when no receiver is given (e.g. workspace doIts).
- Makes ChangeLists/Records 'homemodule-aware' too. "

4680betterModuleScoping2-hg -- Henrik Gedenryd -- 28 November 2001
Make the sensitive switch to the new scoping methods."

4681PoolRewrite-HG

4682decemberChanges-hg

4683decemberChanges2-hg

4684RegFileList-hgglsd -- Henrik Gedenryd, Gerald Leeb and Stephane Ducasse -- 10 November 2001
Version 3.0 - 16 Nov 2001
Prerequisites: 
		HookForRemoveFromSystem.cs version 1.
		SUnit any version
This changeset introduces an important architectural change in the design of the FileList. The FileList now proposes a registration mechanism to which any tools the filelist use ***MUST*** register. This way it is possible to load dynamically a new tool or unload and to have the FileList automatically updated. This change supports a decomposition of Squeak and removes problem with dead reference to classes after a major shrink.
Tools should implement the method fileReaderServicesForSuffix: suffix
(look for sender in the image) and register to the FileList calling the class method registerFileReader: aProvider when they load in. There is a testSuite called FileListTest that presents some example. 
A tool register by providing a SimpleEntryService. It is composed by a class, a menu label and a method selector having one argument. See example below. The convention right now is that the argument is the path of the selected file when one file is selected and the fileList itself when no file is selected. It seems an arbitrary choice but this is the one that avoid to declare method with explicit reference to file list in reader. Hence decouple the most the reader and the file list. 
Note that this regsitration mechanism relies on the fact that the file list is on the image. In the future we may introduce another object that we know will be always in the image. 
To do list: 
		look for 
	- self flag: #shouldBeChangedToReflectThatToolsCanBeRemoved.
	- self flag: #ViolateNonReferenceToOtherClasses.
	
stef
History: 
Stef 10 November 2001.
- documented an edited the preamble + class comment.
- Added the possibility to unregister a tool, to check if a given tool was registered. This help to build default menu.
- remove a bug with browseFile. Now we can also selectAndBrowse file when no file are selected in a way enforced by the registration mechanism. 
- Remove one possible bug the class variable was lazzily accessed 
from the class side but there was an instance methods returned 
it directly. This would have returned nil instead of an empty collection.
- renamed some methods to use the same vocabulary
- fixed genie registration. Now genie uses the registration mechanism too.
- fixed zipArchive registration
- fixed alice registration 
- removing a class form the image  also unregisters the tools
	for that purpose I introduced a hook method in the Class>>removeFromSystem: that per
	default does nothing. But using this hook instead of specializing removeFromSystem: 	does not let the responsibility to the class developer to call super removeFromSystem:
To do:
Check all the code and add some flag: method to indicate future work to do.
check for example flag: #ViolateNonReferenceToOtherClasses and 
shouldBeChangedToReflectThatToolsCanBeRemoved
- For example, some classes like ServerDirectory are still directly referenced via menu action. They could be the target of another iteration. 
Example: 
The method FileList>>itemsForFileEnding: retrieves the menu entries via ReaderServices.
Each class can register itself as ReaderService with:
	FileList registerFileReader: self.
The FileList collects the service entries for a file suffix by the message
#fileReaderServicesForSuffix: of each ReaderService.
Example:
FlashMorphReader>>fileReaderServicesForSuffix: suffix
	^(suffix = 'swf') | (suffix = '*') 
		ifTrue: [
			{SimpleServiceEntry 
				provider: self 
				label: 'open as Flash'
				selector: #openAsFlash:}]
		ifFalse: [#()]

4685topologicalSort-hg -- Henrik Gedenryd -- 17 December 2001
This adds topological sorting capabilities to SortedCollection, with no claims to great efficiency (and simplifies some code in the same class). Best used with 
	aCollection topologicallySortedUsing: sortBlock
A topological sort arranges items according to a partial order, i.e., when some pairs of items do not have any comparison. A new Boolean methods, ==> (implicature, a.k.a. if...then...) is helpful for defining such relationships.
Example:
aString topologicallySortedUsing: [:a :b | (a isUppercase == b isUppercase) ==> [a <= b]]
This only specifies an alphabetical order between letters of the same case, try e.g.
('ThisIsMyString' topologicallySortedUsing: [:a :b | a isUppercase == b isUppercase ==> [a <= b]]) as: String 
Note that an ordinary sort will do this incorrectly:
('ThisIsMyString' asSortedCollection: [:a :b | a isUppercase == b isUppercase ==> [a <= b]]) as: String "

4686someModuleTests-hg -- Henrik Gedenryd -- 2 January 2002
The ModuleTests and ModuleStorageTests should pass, but especially the latter tests are incomplete as yet.
The DeltaModuleTests are obviously far from done.
The PoolTests are obsolete and should really be removed.
The ModuleSystemIntegrityTests are not unit tests as such. Moreover the stock image has non-readonly bindings for pool vars and some globals, causing one integrity test to fail."

4687deltaImprovements-hg -- Henrik Gedenryd -- 27 January 2002
Tests for DeltaModules and storage, fixes that make them pass, and more."
"some classes weren't exported due to an intermediate state"
Module root deepSubmodulesDo: [:m |
	m definedNames keysAndValuesDo: [:k :v | 
		(m exportedNames at: k ifAbsent: [nil]) ifNil: [
			(m ~~ Module smalltalk and: [v isKindOf: Class]) ifTrue: [m exportName: k]]]].

4688deltaImprovements2-hg

4689FileList-putUpdate




More information about the Squeak-dev mailing list