[Pkg] The Trunk: Kernel-cwp.832.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Jan 18 15:38:47 UTC 2014

Colin Putney uploaded a new version of Kernel to project The Trunk:

==================== Summary ====================

Name: Kernel-cwp.832
Author: cwp
Time: 18 January 2014, 10:36:05.863 am
UUID: 8aa9fb24-86f6-43bb-b925-d5b6e7d47022
Ancestors: Kernel-nice.831

Remove references to Undeclared and route through the appropriate environment.

=============== Diff against Kernel-nice.831 ===============

Item was changed:
  ----- Method: Behavior>>environment (in category 'accessing') -----
+ 	"Return the environment in which the receiver is declared"
- 	"Return the environment in which the receiver is visible"
  	^Smalltalk globals!

Item was changed:
  ----- Method: Behavior>>literalScannedAs:notifying: (in category 'printing') -----
  literalScannedAs: scannedLiteral notifying: requestor
  	"Postprocesses a literal scanned by Scanner scanToken (esp. xLitQuote).
  	If scannedLiteral is not an association, answer it.
  	Else, if it is of the form:
  	answer nil->theMetaclass, if any has that name, else report an error.
  	Else, if it is of the form:
  	answer the global, class, or pool association with that nameE, if any, else
  	add it to Undeclared a answer the new Association."
  	| key value |
  	(scannedLiteral isVariableBinding)
  		ifFalse: [^ scannedLiteral].
  	key := scannedLiteral key.
  	value := scannedLiteral value.
  	key isNil 
  		ifTrue: "###<metaclass soleInstance name>"
  			[(self bindingOf: value) ifNotNil:[:assoc|
  				 (assoc value isKindOf: Behavior)
  					ifTrue: [^ nil->assoc value class]].
  			 requestor notify: 'No such metaclass'.
  	(key isSymbol)
  		ifTrue: "##<global var name>"
+ 			[^ (self bindingOf: key) ifNil:
+ 				[self environment undeclare: key]].
- 			[(self bindingOf: key) ifNotNil:[:assoc | ^assoc].
- 			Undeclared at: key put: nil.
- 			 ^Undeclared bindingOf: key].
  	requestor notify: '## must be followed by a non-local variable name'.
  "	Form literalScannedAs: 14 notifying: nil 14
  	Form literalScannedAs: #OneBitForm notiEfying: nil  OneBitForm
  	Form literalScannedAs: ##OneBitForm notifying: nil  OneBitForm->a Form
  	Form literalScannedAs: ##Form notifying: nil   Form->Form
  	Form literalScannedAs: ###Form notifying: nil   nilE->Form class

Item was changed:
  ----- Method: Class>>removeClassVarName: (in category 'class variables') -----
  removeClassVarName: aString 
  	"Remove the class variable whose name is the argument, aString, from 
  	the names defined in the receiver, a class. Create an error notification if 
  	aString is not a class variable or if it is still being used in the code of 
  	the class."
  	| aSymbol |
  	aSymbol := aString asSymbol.
  	(classPool includesKey: aSymbol)
  		ifFalse: [^self error: aString, ' is not a class variable'].
  	self withAllSubclasses do:[:subclass |
  		(Array with: subclass with: subclass class) do:[:classOrMeta |
  			(classOrMeta whichSelectorsReferTo: (classPool associationAt: aSymbol))
  				isEmpty ifFalse: [
  					InMidstOfFileinNotification signal ifTrue: [
  						Transcript cr; show: self name, ' (' , aString , ' is Undeclared) '.
+ 						^self environment undeclare: aSymbol from: classPool].
- 						^self environment undeclared declare: aSymbol from: classPool].
  					(self confirm: (aString,' is still used in code of class ', classOrMeta name,
  						'.\Is it okay to move it to Undeclared?') withCRs)
+ 						ifTrue:[^ self environment undeclare: aSymbol from: classPool]
- 						ifTrue:[^Undeclared declare: aSymbol from: classPool]
  	classPool removeKey: aSymbol.
  	classPool isEmpty ifTrue: [classPool := nil].

More information about the Packages mailing list