[squeak-dev] The Trunk: Kernel-ul.624.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Sep 17 19:31:25 UTC 2011


Levente Uzonyi uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ul.624.mcz

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

Name: Kernel-ul.624
Author: ul
Time: 17 September 2011, 5:42:53.901 pm
UUID: 540746a6-bd79-7543-bcad-ea7f1973d6c5
Ancestors: Kernel-eem.623, Kernel-ul.613, Kernel-ul.619

- merged Kernel-ul.613 and Kernel-ul.619
- ProcessLocalVariable class >> value: returns it's argument just like assignments

=============== Diff against Kernel-eem.623 ===============

Item was changed:
  SystemOrganization addCategory: #'Kernel-Chronology'!
  SystemOrganization addCategory: #'Kernel-Classes'!
  SystemOrganization addCategory: #'Kernel-Methods'!
+ SystemOrganization addCategory: #'Kernel-Models'!
  SystemOrganization addCategory: #'Kernel-Numbers'!
  SystemOrganization addCategory: #'Kernel-Objects'!
  SystemOrganization addCategory: #'Kernel-Processes'!
+ SystemOrganization addCategory: #'Kernel-Processes-Variables'!
- SystemOrganization addCategory: #'Kernel-Models'!

Item was added:
+ ProcessSpecificVariable subclass: #DynamicVariable
+ 	instanceVariableNames: ''
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'Kernel-Processes-Variables'!
+ 
+ !DynamicVariable commentStamp: 'mvl 3/13/2007 13:55' prior: 0!
+ My subclasses are dynamic variables: each subclass represents a variable
+ whose value persists inside the block passed to #value:during:. There is
+ no way to change the value inside such a block, but it is possible to
+ temporarirly rebind it in a nested manner.!

Item was added:
+ ----- Method: DynamicVariable class>>value:during: (in category 'accessing') -----
+ value: anObject during: aBlock
+ 
+ 	| p oldValue |
+ 	p := Processor activeProcess.
+ 	oldValue := p environmentAt: self ifAbsent: [self default].
+ 	^[
+ 		p environmentAt: self put: anObject.
+ 		aBlock value ] 
+ 			ensure: [ p environmentAt: self put: oldValue ].!

Item was changed:
  ----- Method: Monitor>>exitAndWaitInQueue:maxMilliseconds: (in category 'private') -----
  exitAndWaitInQueue: anOrderedCollection maxMilliseconds: anIntegerOrNil
+ 
+ 	[ 
+ 		| lock |
+ 		lock := queuesMutex critical: [ anOrderedCollection addLast: Semaphore new ].
+ 		self exit.
+ 		anIntegerOrNil 
+ 			ifNil: [ lock wait 	]
+ 			ifNotNil: [
+ 				| delay |
+ 				delay := MonitorDelay 
+ 					signalLock: lock
+ 					afterMSecs: anIntegerOrNil
+ 					inMonitor: self
+ 					queue: anOrderedCollection.
+ 				[ lock wait ] ensure: [ delay unschedule ] ] ]
+ 		ensure: [ self enter ]!
- 	| lock delay |
- 	lock := queuesMutex 
- 		critical: [anOrderedCollection addLast: Semaphore new].
- 	self exit.
- 	anIntegerOrNil ifNil: [
- 		lock wait
- 	] ifNotNil: [
- 		delay := MonitorDelay signalLock: lock afterMSecs: anIntegerOrNil inMonitor: self queue: anOrderedCollection.
- 		lock wait.
- 		delay unschedule.
- 	].
- 	self enter.!

Item was added:
+ ----- Method: Process>>environmentAt: (in category 'process specific') -----
+ environmentAt: key 
+ 	^ self environmentAt: key ifAbsent: [self environmentKeyNotFound]!

Item was added:
+ ----- Method: Process>>environmentAt:ifAbsent: (in category 'process specific') -----
+ environmentAt: key  ifAbsent: aBlock
+ 	
+ 	^(env ifNil: [ ^aBlock value ]) at: key ifAbsent: aBlock.!

Item was added:
+ ----- Method: Process>>environmentAt:put: (in category 'process specific') -----
+ environmentAt: key put: value
+ 	
+ 	^(env ifNil: [ env := Dictionary new ]) at: key put: value.!

Item was added:
+ ----- Method: Process>>environmentKeyNotFound (in category 'process specific') -----
+ environmentKeyNotFound 
+ 	self error: 'Environment key not found'!

Item was added:
+ ----- Method: Process>>environmentRemoveKey: (in category 'process specific') -----
+ environmentRemoveKey: key
+ 	^ self environmentRemoveKey: key ifAbsent: [self environmentKeyNotFound]!

Item was added:
+ ----- Method: Process>>environmentRemoveKey:ifAbsent: (in category 'process specific') -----
+ environmentRemoveKey: key ifAbsent: errorBlock
+ 	
+ 	^(env ifNil: [ ^errorBlock value ]) removeKey: key ifAbsent: errorBlock!

Item was added:
+ ProcessSpecificVariable subclass: #ProcessLocalVariable
+ 	instanceVariableNames: ''
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'Kernel-Processes-Variables'!
+ 
+ !ProcessLocalVariable commentStamp: 'mvl 3/13/2007 12:28' prior: 0!
+ My subclasses have values specific to the active process. They can be read with #value and set with #value:!

Item was added:
+ ----- Method: ProcessLocalVariable class>>value: (in category 'accessing') -----
+ value: anObject
+ 	
+ 	^Processor activeProcess environmentAt: self put: anObject!

Item was added:
+ Object subclass: #ProcessSpecificVariable
+ 	instanceVariableNames: ''
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'Kernel-Processes-Variables'!
+ ProcessSpecificVariable class
+ 	instanceVariableNames: 'hash'!
+ 
+ !ProcessSpecificVariable commentStamp: 'mvl 3/13/2007 13:53' prior: 0!
+ My subclasses (not instances of them) keep state specific to the current process.
+ 
+ There are two kinds of process-specific variables: process-local (state available
+ for read and write in all methods inside the process), and dynamic variables
+ (implementing dynamic scope).!
+ ProcessSpecificVariable class
+ 	instanceVariableNames: 'hash'!

Item was added:
+ ----- Method: ProcessSpecificVariable class>>default (in category 'accessing') -----
+ default
+ 	"Answer the default value for the variable. The default for the default value is nil."
+ 	^nil!

Item was added:
+ ----- Method: ProcessSpecificVariable class>>hash (in category 'accessing') -----
+ hash
+ 	
+ 	^hash ifNil: [ hash := super hash ]!

Item was added:
+ ----- Method: ProcessSpecificVariable class>>value (in category 'accessing') -----
+ value
+ 	"Answer the current value for this variable in the current context."
+ 	^Processor activeProcess environmentAt: self ifAbsent: [self default].!




More information about the Squeak-dev mailing list