Levente Uzonyi uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-ul.423.mcz
==================== Summary ====================
Name: System-ul.423
Author: ul
Time: 28 February 2011, 12:05:19.782 pm
UUID: 5334bfde-1537-fa4a-8491-4219f54632ce
Ancestors: System-ul.422
- moved all class and trait access logic from SmalltalkImage to SystemDictionary
- simplified a few methods in SystemDictionary
=============== Diff against System-ul.422 ===============
Item was changed:
----- Method: SmalltalkImage>>allClasses (in category 'classes and traits') -----
allClasses
"Return all the class defined in the system"
+ ^globals allClasses!
- ^Array streamContents:[:s| self allClassesDo:[:aClass| s nextPut: aClass]].!
Item was changed:
----- Method: SmalltalkImage>>allClassesAndTraits (in category 'classes and traits') -----
allClassesAndTraits
"Return all the classes and traits defined in the system"
+ ^globals allClassesAndTraits!
- ^Array streamContents:[:s| self allClassesAndTraitsDo:[:each| s nextPut: each]].!
Item was changed:
----- Method: SmalltalkImage>>allClassesAndTraitsDo: (in category 'classes and traits') -----
allClassesAndTraitsDo: aBlock
"Evaluate the argument, aBlock, for each class and trait in the system."
+ globals allClassesAndTraitsDo: aBlock!
- self allClassesDo: aBlock.
- self allTraitsDo: aBlock.
- !
Item was changed:
----- Method: SmalltalkImage>>allClassesDo: (in category 'classes and traits') -----
allClassesDo: aBlock
"Evaluate the argument, aBlock, for each class in the system."
+ globals allClassesDo: aBlock!
- ^globals allClassesDo: aBlock!
Item was changed:
----- Method: SmalltalkImage>>allTraits (in category 'classes and traits') -----
allTraits
"Return all traits defined in the system"
+ ^globals allTraits!
- ^Array streamContents:[:s| self allTraitsDo:[:aTrait| s nextPut: aTrait]].!
Item was changed:
----- Method: SmalltalkImage>>allTraitsDo: (in category 'classes and traits') -----
allTraitsDo: aBlock
"Evaluate the argument, aBlock, for each trait in the system."
+ globals allTraitsDo: aBlock!
- ^globals allTraitsDo: aBlock!
Item was changed:
----- Method: SmalltalkImage>>classNames (in category 'classes and traits') -----
classNames
"Answer a collection of all class names in the system."
+ ^globals classNames!
- ^self allClasses collect:[:aClass| aClass name].!
Item was changed:
----- Method: SmalltalkImage>>traitNames (in category 'classes and traits') -----
traitNames
"Answer a SortedCollection of all traits (not including class-traits) names."
+ ^globals traitNames!
- ^self allTraits collect:[:aTrait| aTrait name].!
Item was changed:
----- Method: SystemDictionary>>allClassesAndTraits (in category 'classes and traits') -----
allClassesAndTraits
"Return all the classes and traits defined in the Smalltalk SystemDictionary"
+ ^Array streamContents: [ :stream |
+ self allClassesAndTraitsDo: [ :each | stream nextPut: each ] ]!
- ^ self classNames , self traitNames collect: [:each | self at: each]!
Item was changed:
----- Method: SystemDictionary>>allClassesAndTraitsDo: (in category 'classes and traits') -----
allClassesAndTraitsDo: aBlock
+
+ self
+ allClassesDo: aBlock;
+ allTraitsDo: aBlock!
- ^self allClassesAndTraits do: aBlock!
Item was changed:
----- Method: SystemDictionary>>allClassesDo: (in category 'classes and traits') -----
allClassesDo: aBlock
"Evaluate the argument, aBlock, for each class in the system."
+ self classNames do: [ :name |
+ aBlock value: (self at: name) ]!
- (self classNames collect: [:name | self at: name]) do: aBlock!
Item was changed:
----- Method: SystemDictionary>>allTraitsDo: (in category 'classes and traits') -----
allTraitsDo: aBlock
"Evaluate the argument, aBlock, for each trait in the system."
+ self traitNames do: [ :name |
+ aBlock value: (self at: name) ]!
- (self traitNames collect: [:name | self at: name]) do: aBlock!
Item was changed:
----- Method: SystemDictionary>>classAndTraitNames (in category 'classes and traits') -----
classAndTraitNames
"Answer a sorted collection of all class and trait (not including class-traits) names. The performance of this algorithm is O(n) if the classNames are already cached, otherwise O(n*log(n)) where n is self size."
| classNames traitNames result temporary |
classNames := self classNames.
+ traitNames := self traitNames ifEmpty: [ ^classNames ].
- traitNames := self traitNames.
- traitNames ifEmpty: [^classNames].
temporary := Array new: classNames size + traitNames size.
result := temporary shallowCopy.
temporary
replaceFrom: 1
to: classNames size
with: classNames
startingAt: 1;
replaceFrom: classNames size + 1
to: temporary size
with: traitNames
startingAt: 1;
mergeFirst: 1
middle: classNames size
last: temporary size
into: result
by: nil.
^result!
Levente Uzonyi uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-ul.423.mcz
==================== Summary ====================
Name: System-ul.423
Author: ul
Time: 28 February 2011, 12:05:19.782 pm
UUID: 5334bfde-1537-fa4a-8491-4219f54632ce
Ancestors: System-ul.422
- moved all class and trait access logic from SmalltalkImage to SystemDictionary
- simplified a few methods in SystemDictionary
=============== Diff against System-ul.422 ===============
Item was changed:
----- Method: SmalltalkImage>>allClasses (in category 'classes and traits') -----
allClasses
"Return all the class defined in the system"
+ ^globals allClasses!
- ^Array streamContents:[:s| self allClassesDo:[:aClass| s nextPut: aClass]].!
Item was changed:
----- Method: SmalltalkImage>>allClassesAndTraits (in category 'classes and traits') -----
allClassesAndTraits
"Return all the classes and traits defined in the system"
+ ^globals allClassesAndTraits!
- ^Array streamContents:[:s| self allClassesAndTraitsDo:[:each| s nextPut: each]].!
Item was changed:
----- Method: SmalltalkImage>>allClassesAndTraitsDo: (in category 'classes and traits') -----
allClassesAndTraitsDo: aBlock
"Evaluate the argument, aBlock, for each class and trait in the system."
+ globals allClassesAndTraitsDo: aBlock!
- self allClassesDo: aBlock.
- self allTraitsDo: aBlock.
- !
Item was changed:
----- Method: SmalltalkImage>>allClassesDo: (in category 'classes and traits') -----
allClassesDo: aBlock
"Evaluate the argument, aBlock, for each class in the system."
+ globals allClassesDo: aBlock!
- ^globals allClassesDo: aBlock!
Item was changed:
----- Method: SmalltalkImage>>allTraits (in category 'classes and traits') -----
allTraits
"Return all traits defined in the system"
+ ^globals allTraits!
- ^Array streamContents:[:s| self allTraitsDo:[:aTrait| s nextPut: aTrait]].!
Item was changed:
----- Method: SmalltalkImage>>allTraitsDo: (in category 'classes and traits') -----
allTraitsDo: aBlock
"Evaluate the argument, aBlock, for each trait in the system."
+ globals allTraitsDo: aBlock!
- ^globals allTraitsDo: aBlock!
Item was changed:
----- Method: SmalltalkImage>>classNames (in category 'classes and traits') -----
classNames
"Answer a collection of all class names in the system."
+ ^globals classNames!
- ^self allClasses collect:[:aClass| aClass name].!
Item was changed:
----- Method: SmalltalkImage>>traitNames (in category 'classes and traits') -----
traitNames
"Answer a SortedCollection of all traits (not including class-traits) names."
+ ^globals traitNames!
- ^self allTraits collect:[:aTrait| aTrait name].!
Item was changed:
----- Method: SystemDictionary>>allClassesAndTraits (in category 'classes and traits') -----
allClassesAndTraits
"Return all the classes and traits defined in the Smalltalk SystemDictionary"
+ ^Array streamContents: [ :stream |
+ self allClassesAndTraitsDo: [ :each | stream nextPut: each ] ]!
- ^ self classNames , self traitNames collect: [:each | self at: each]!
Item was changed:
----- Method: SystemDictionary>>allClassesAndTraitsDo: (in category 'classes and traits') -----
allClassesAndTraitsDo: aBlock
+
+ self
+ allClassesDo: aBlock;
+ allTraitsDo: aBlock!
- ^self allClassesAndTraits do: aBlock!
Item was changed:
----- Method: SystemDictionary>>allClassesDo: (in category 'classes and traits') -----
allClassesDo: aBlock
"Evaluate the argument, aBlock, for each class in the system."
+ self classNames do: [ :name |
+ aBlock value: (self at: name) ]!
- (self classNames collect: [:name | self at: name]) do: aBlock!
Item was changed:
----- Method: SystemDictionary>>allTraitsDo: (in category 'classes and traits') -----
allTraitsDo: aBlock
"Evaluate the argument, aBlock, for each trait in the system."
+ self traitNames do: [ :name |
+ aBlock value: (self at: name) ]!
- (self traitNames collect: [:name | self at: name]) do: aBlock!
Item was changed:
----- Method: SystemDictionary>>classAndTraitNames (in category 'classes and traits') -----
classAndTraitNames
"Answer a sorted collection of all class and trait (not including class-traits) names. The performance of this algorithm is O(n) if the classNames are already cached, otherwise O(n*log(n)) where n is self size."
| classNames traitNames result temporary |
classNames := self classNames.
+ traitNames := self traitNames ifEmpty: [ ^classNames ].
- traitNames := self traitNames.
- traitNames ifEmpty: [^classNames].
temporary := Array new: classNames size + traitNames size.
result := temporary shallowCopy.
temporary
replaceFrom: 1
to: classNames size
with: classNames
startingAt: 1;
replaceFrom: classNames size + 1
to: temporary size
with: traitNames
startingAt: 1;
mergeFirst: 1
middle: classNames size
last: temporary size
into: result
by: nil.
^result!
Levente Uzonyi uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-fbs.108.mcz
==================== Summary ====================
Name: Network-fbs.108
Author: fbs
Time: 18 February 2011, 11:00:05.486 am
UUID: 228bf8a5-3dd5-be4f-a34b-2223842e5bab
Ancestors: Network-nice.107
Provide a (TCP) data send with explicit timeout. The existing method (Socket>>sendSomeData:startIndex:count:) calls the new method with a default timeout of 20s.
=============== Diff against Network-nice.107 ===============
Item was changed:
----- Method: Socket>>sendSomeData:startIndex:count: (in category 'sending') -----
sendSomeData: aStringOrByteArray startIndex: startIndex count: count
+ ^ self sendSomeData: aStringOrByteArray startIndex: startIndex count: count for: 20.!
- "Send up to count bytes of the given data starting at the given index. Answer the number of bytes actually sent."
- "Note: This operation may have to be repeated multiple times to send a large amount of data."
-
- | bytesSent |
- (self waitForSendDoneFor: 20)
- ifTrue: [
- bytesSent := self primSocket: socketHandle
- sendData: aStringOrByteArray
- startIndex: startIndex
- count: count]
- ifFalse: [ConnectionTimedOut signal: 'send data timeout; data not sent'].
- ^ bytesSent
- !
Item was added:
+ ----- Method: Socket>>sendSomeData:startIndex:count:for: (in category 'sending') -----
+ sendSomeData: aStringOrByteArray startIndex: startIndex count: count for: aTimeoutInSeconds
+ "Send up to count bytes of the given data starting at the given index. Answer the number of bytes actually sent."
+ "Note: This operation may have to be repeated multiple times to send a large amount of data."
+
+ | bytesSent |
+ (self waitForSendDoneFor: aTimeoutInSeconds)
+ ifTrue: [
+ bytesSent := self primSocket: socketHandle
+ sendData: aStringOrByteArray
+ startIndex: startIndex
+ count: count]
+ ifFalse: [ConnectionTimedOut signal: 'send data timeout; data not sent'].
+ ^ bytesSent
+ !
Levente Uzonyi uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-fbs.108.mcz
==================== Summary ====================
Name: Network-fbs.108
Author: fbs
Time: 18 February 2011, 11:00:05.486 am
UUID: 228bf8a5-3dd5-be4f-a34b-2223842e5bab
Ancestors: Network-nice.107
Provide a (TCP) data send with explicit timeout. The existing method (Socket>>sendSomeData:startIndex:count:) calls the new method with a default timeout of 20s.
=============== Diff against Network-nice.107 ===============
Item was changed:
----- Method: Socket>>sendSomeData:startIndex:count: (in category 'sending') -----
sendSomeData: aStringOrByteArray startIndex: startIndex count: count
+ ^ self sendSomeData: aStringOrByteArray startIndex: startIndex count: count for: 20.!
- "Send up to count bytes of the given data starting at the given index. Answer the number of bytes actually sent."
- "Note: This operation may have to be repeated multiple times to send a large amount of data."
-
- | bytesSent |
- (self waitForSendDoneFor: 20)
- ifTrue: [
- bytesSent := self primSocket: socketHandle
- sendData: aStringOrByteArray
- startIndex: startIndex
- count: count]
- ifFalse: [ConnectionTimedOut signal: 'send data timeout; data not sent'].
- ^ bytesSent
- !
Item was added:
+ ----- Method: Socket>>sendSomeData:startIndex:count:for: (in category 'sending') -----
+ sendSomeData: aStringOrByteArray startIndex: startIndex count: count for: aTimeoutInSeconds
+ "Send up to count bytes of the given data starting at the given index. Answer the number of bytes actually sent."
+ "Note: This operation may have to be repeated multiple times to send a large amount of data."
+
+ | bytesSent |
+ (self waitForSendDoneFor: aTimeoutInSeconds)
+ ifTrue: [
+ bytesSent := self primSocket: socketHandle
+ sendData: aStringOrByteArray
+ startIndex: startIndex
+ count: count]
+ ifFalse: [ConnectionTimedOut signal: 'send data timeout; data not sent'].
+ ^ bytesSent
+ !
Levente Uzonyi uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-fbs.108.mcz
==================== Summary ====================
Name: Network-fbs.108
Author: fbs
Time: 18 February 2011, 11:00:05.486 am
UUID: 228bf8a5-3dd5-be4f-a34b-2223842e5bab
Ancestors: Network-nice.107
Provide a (TCP) data send with explicit timeout. The existing method (Socket>>sendSomeData:startIndex:count:) calls the new method with a default timeout of 20s.
=============== Diff against Network-nice.107 ===============
Item was changed:
----- Method: Socket>>sendSomeData:startIndex:count: (in category 'sending') -----
sendSomeData: aStringOrByteArray startIndex: startIndex count: count
+ ^ self sendSomeData: aStringOrByteArray startIndex: startIndex count: count for: 20.!
- "Send up to count bytes of the given data starting at the given index. Answer the number of bytes actually sent."
- "Note: This operation may have to be repeated multiple times to send a large amount of data."
-
- | bytesSent |
- (self waitForSendDoneFor: 20)
- ifTrue: [
- bytesSent := self primSocket: socketHandle
- sendData: aStringOrByteArray
- startIndex: startIndex
- count: count]
- ifFalse: [ConnectionTimedOut signal: 'send data timeout; data not sent'].
- ^ bytesSent
- !
Item was added:
+ ----- Method: Socket>>sendSomeData:startIndex:count:for: (in category 'sending') -----
+ sendSomeData: aStringOrByteArray startIndex: startIndex count: count for: aTimeoutInSeconds
+ "Send up to count bytes of the given data starting at the given index. Answer the number of bytes actually sent."
+ "Note: This operation may have to be repeated multiple times to send a large amount of data."
+
+ | bytesSent |
+ (self waitForSendDoneFor: aTimeoutInSeconds)
+ ifTrue: [
+ bytesSent := self primSocket: socketHandle
+ sendData: aStringOrByteArray
+ startIndex: startIndex
+ count: count]
+ ifFalse: [ConnectionTimedOut signal: 'send data timeout; data not sent'].
+ ^ bytesSent
+ !