Levente Uzonyi uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-ul.386.mcz
==================== Summary ====================
Name: Tools-ul.386
Author: ul
Time: 6 December 2011, 3:47:09.09 pm
UUID: fc4b47c7-76fd-ec44-8007-2dd1fa8f227e
Ancestors: Tools-ul.385
Fix for http://bugs.squeak.org/view.php?id=7678 .
=============== Diff against Tools-ul.385 ===============
Item was changed:
----- Method: SelectorBrowser>>quickList (in category 'as yet unclassified') -----
quickList
"Compute the selectors for the single example of receiver and args, in the very top pane"
| data result resultArray dataStrings mf dataObjects aa statements |
+ data := contents asString withBlanksTrimmed.
- data := contents asString.
- "delete t
- railing period. This should be fixed in the Parser!!"
- [data last isSeparator] whileTrue: [data := data allButLast].
- data last = $. ifTrue: [data := data allButLast]. "Eval"
mf := MethodFinder new.
data := mf cleanInputs: data. "remove common mistakes"
dataObjects := Compiler evaluate: '{', data, '}'. "#( data1 data2 result )"
statements := (Compiler new parse: 'zort ' , data in: Object notifying: nil)
body statements select: [:each | (each isKindOf: ReturnNode) not].
dataStrings := statements collect:
[:node | String streamContents:
[:strm | (node isMessage) ifTrue: [strm nextPut: $(].
node shortPrintOn: strm.
(node isMessage) ifTrue: [strm nextPut: $)].]].
dataObjects size < 2 ifTrue: [self inform: 'If you are giving an example of receiver, \args, and result, please put periods between the parts.\Otherwise just type one selector fragment' withCRs. ^#()].
dataObjects := Array with: dataObjects allButLast with: dataObjects last. "#( (data1
data2) result )"
result := mf load: dataObjects; findMessage.
(result first beginsWith: 'no single method') ifFalse: [
aa := self testObjects: dataObjects strings: dataStrings.
dataObjects := aa second. dataStrings := aa third].
resultArray := self listFromResult: result.
resultArray isEmpty ifTrue: [self inform: result first].
dataStrings size = (dataObjects first size + 1) ifTrue:
[resultArray := resultArray collect: [:expression | | newExp |
newExp := expression.
dataObjects first withIndexDo: [:lit :i |
newExp := newExp copyReplaceAll: 'data', i printString
with: (dataStrings at: i)].
newExp, ' --> ', dataStrings last]].
^ resultArray!
Levente Uzonyi uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-ul.122.mcz
==================== Summary ====================
Name: Network-ul.122
Author: ul
Time: 5 December 2011, 1:57:58.816 am
UUID: 03150d0c-8fb9-e84b-9ec8-3d541a4eb602
Ancestors: Network-ul.121
- fix: SocketStream >> #upTo: returned at most 100000 bytes/characters.
- fix: Added a workaround to Socket >> #waitForDataIfClosed: for the Cog bug, which causes lost signals of Sockets' readSemaphore .
=============== Diff against Network-ul.121 ===============
Item was changed:
----- Method: Socket>>waitForDataIfClosed: (in category 'waiting') -----
waitForDataIfClosed: closedBlock
"Wait indefinitely for data to arrive. This method will block until
data is available or the socket is closed."
[
(self primSocketReceiveDataAvailable: socketHandle)
ifTrue: [^self].
self isConnected
ifFalse: [^closedBlock value].
+ "This 500 ms waiting is a workaround for a VM bug which causes sockets waiting for data forever randomly, because the semaphore doesn't get signaled. Revert to ""self readSemaphore wait"" when the bug is fixed."
+ self readSemaphore waitTimeoutMSecs: 500 ] repeat
- self readSemaphore wait ] repeat
!
Item was changed:
----- Method: SocketStream>>upTo: (in category 'stream in') -----
upTo: aCharacterOrByte
+ "Answer a subcollection from the current access position to the occurrence (if any, but not inclusive) of anObject in the receiver. If anObject is not in the collection, answer the entire rest of the receiver."
- "Answer a subcollection from the current access position to the occurrence (if any, but not inclusive) of anObject in the receiver. If anObject is not in the collection, answer the entire rest of the receiver."
+ ^self upTo: aCharacterOrByte limit: nil!
- "Note: The 100k limit below is compatible with the previous version though arguably incorrect. If you need unbounded behavior either up the argument or provide nil in which case we'll read until we get it or run out of memory"
-
- ^self upTo: aCharacterOrByte limit: 100000!
Levente Uzonyi uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-ul.122.mcz
==================== Summary ====================
Name: Network-ul.122
Author: ul
Time: 5 December 2011, 1:57:58.816 am
UUID: 03150d0c-8fb9-e84b-9ec8-3d541a4eb602
Ancestors: Network-ul.121
- fix: SocketStream >> #upTo: returned at most 100000 bytes/characters.
- fix: Added a workaround to Socket >> #waitForDataIfClosed: for the Cog bug, which causes lost signals of Sockets' readSemaphore .
=============== Diff against Network-ul.121 ===============
Item was changed:
----- Method: Socket>>waitForDataIfClosed: (in category 'waiting') -----
waitForDataIfClosed: closedBlock
"Wait indefinitely for data to arrive. This method will block until
data is available or the socket is closed."
[
(self primSocketReceiveDataAvailable: socketHandle)
ifTrue: [^self].
self isConnected
ifFalse: [^closedBlock value].
+ "This 500 ms waiting is a workaround for a VM bug which causes sockets waiting for data forever randomly, because the semaphore doesn't get signaled. Revert to ""self readSemaphore wait"" when the bug is fixed."
+ self readSemaphore waitTimeoutMSecs: 500 ] repeat
- self readSemaphore wait ] repeat
!
Item was changed:
----- Method: SocketStream>>upTo: (in category 'stream in') -----
upTo: aCharacterOrByte
+ "Answer a subcollection from the current access position to the occurrence (if any, but not inclusive) of anObject in the receiver. If anObject is not in the collection, answer the entire rest of the receiver."
- "Answer a subcollection from the current access position to the occurrence (if any, but not inclusive) of anObject in the receiver. If anObject is not in the collection, answer the entire rest of the receiver."
+ ^self upTo: aCharacterOrByte limit: nil!
- "Note: The 100k limit below is compatible with the previous version though arguably incorrect. If you need unbounded behavior either up the argument or provide nil in which case we'll read until we get it or run out of memory"
-
- ^self upTo: aCharacterOrByte limit: 100000!
Levente Uzonyi uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-ul.122.mcz
==================== Summary ====================
Name: Network-ul.122
Author: ul
Time: 5 December 2011, 1:57:58.816 am
UUID: 03150d0c-8fb9-e84b-9ec8-3d541a4eb602
Ancestors: Network-ul.121
- fix: SocketStream >> #upTo: returned at most 100000 bytes/characters.
- fix: Added a workaround to Socket >> #waitForDataIfClosed: for the Cog bug, which causes lost signals of Sockets' readSemaphore .
=============== Diff against Network-ul.121 ===============
Item was changed:
----- Method: Socket>>waitForDataIfClosed: (in category 'waiting') -----
waitForDataIfClosed: closedBlock
"Wait indefinitely for data to arrive. This method will block until
data is available or the socket is closed."
[
(self primSocketReceiveDataAvailable: socketHandle)
ifTrue: [^self].
self isConnected
ifFalse: [^closedBlock value].
+ "This 500 ms waiting is a workaround for a VM bug which causes sockets waiting for data forever randomly, because the semaphore doesn't get signaled. Revert to ""self readSemaphore wait"" when the bug is fixed."
+ self readSemaphore waitTimeoutMSecs: 500 ] repeat
- self readSemaphore wait ] repeat
!
Item was changed:
----- Method: SocketStream>>upTo: (in category 'stream in') -----
upTo: aCharacterOrByte
+ "Answer a subcollection from the current access position to the occurrence (if any, but not inclusive) of anObject in the receiver. If anObject is not in the collection, answer the entire rest of the receiver."
- "Answer a subcollection from the current access position to the occurrence (if any, but not inclusive) of anObject in the receiver. If anObject is not in the collection, answer the entire rest of the receiver."
+ ^self upTo: aCharacterOrByte limit: nil!
- "Note: The 100k limit below is compatible with the previous version though arguably incorrect. If you need unbounded behavior either up the argument or provide nil in which case we'll read until we get it or run out of memory"
-
- ^self upTo: aCharacterOrByte limit: 100000!