Levente Uzonyi uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-ul.187.mcz
==================== Summary ====================
Name: Network-ul.187
Author: ul
Time: 27 February 2017, 2:23:35.659844 am
UUID: 6bb5fee1-2a6c-45d5-98b2-5dae6e7f122c
Ancestors: Network-eem.186
- omit ifAbsent from #index* sends when the default value, 0 would used
=============== Diff against Network-eem.186 ===============
Item was changed:
----- Method: MailAddressTokenizer>>nextComment (in category 'tokenizing') -----
nextComment
| start nestLevel paren |
start := pos.
pos := pos + 1.
nestLevel := 1.
[ nestLevel > 0 ] whileTrue: [
+ pos := text indexOfAnyOf: self class parenthesesSet startingAt: pos.
- pos := text indexOfAnyOf: self class parenthesesSet startingAt: pos ifAbsent: [ 0 ].
pos = 0 ifTrue: [
self error: 'unterminated comment. ie, more (''s than )''s' ].
paren := self nextChar.
paren = $( ifTrue: [ nestLevel := nestLevel + 1 ] ifFalse: [ nestLevel := nestLevel - 1 ]].
^ MailAddressToken type: #Comment
text: (text copyFrom: start to: pos - 1)!
Item was changed:
----- Method: MailAddressTokenizer>>nextDomainLiteral (in category 'tokenizing') -----
nextDomainLiteral
| start end |
start := pos.
+ end := text indexOf: $] startingAt: start.
- end := text indexOf: $] startingAt: start ifAbsent: [ 0 ].
end = 0 ifTrue: [
"not specified"
self error: 'saw [ without a matching ]' ].
pos := end+1.
^MailAddressToken
type: #DomainLiteral
text: (text copyFrom: start to: end)!
Item was changed:
----- Method: SocketStream>>upTo:limit: (in category 'stream in') -----
upTo: aCharacterOrByte limit: nBytes
"Return data up to, but not including given character or byte. If the character is not in the stream, or not found within nBytes answer the available contents of the stream"
| target index result searchedSoFar |
"Deal with ascii vs. binary"
self isBinary
ifTrue:[target := aCharacterOrByte asInteger]
ifFalse:[target := aCharacterOrByte asCharacter].
"Look in the current inBuffer first"
+ index := inBuffer indexOf: target startingAt: lastRead + 1.
- index := inBuffer indexOf: target startingAt: lastRead + 1 ifAbsent:[0].
(index > 0 and: [(index + 1) <= inNextToWrite]) ifTrue: ["found it"
result := self nextInBuffer: index - lastRead - 1.
self skip: 1.
^ result
].
[searchedSoFar := self inBufferSize.
"Receive more data"
self receiveData.
"We only get recentlyRead = 0 in the case of a non-signaling socket close."
recentlyRead > 0] whileTrue:[
"Data begins at lastRead + 1, we add searchedSoFar as offset."
+ index := inBuffer indexOf: target startingAt: (lastRead + searchedSoFar + 1).
- index := inBuffer indexOf: target
- startingAt: (lastRead + searchedSoFar + 1)
- ifAbsent:[0].
(index > 0 and: [(index + 1) <= inNextToWrite]) ifTrue: ["found it"
result := self nextInBuffer: index - lastRead - 1.
self skip: 1.
^ result
].
"Check if we've exceeded the max. amount"
(nBytes notNil and:[inNextToWrite - lastRead > nBytes])
ifTrue:[^self nextAllInBuffer].
].
"not found and (non-signaling) connection was closed"
^self nextAllInBuffer!
Levente Uzonyi uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-ul.202.mcz
==================== Summary ====================
Name: MorphicExtras-ul.202
Author: ul
Time: 27 February 2017, 2:20:59.716292 am
UUID: 5f9ce28c-9742-4cf9-9907-b516125debb8
Ancestors: MorphicExtras-cmm.201
- omit ifAbsent from #index* sends when the default value, 0 would used
=============== Diff against MorphicExtras-cmm.201 ===============
Item was changed:
----- Method: BookMorph>>pageNumberOf: (in category 'accessing') -----
pageNumberOf: aMorph
"Modified so that if the page IS in memory, other pages don't have to be brought in. (This method may wrongly say a page is not here if pages has a tombstone (MorphObjectOut) and that tombstone would resolve to an object already in this image. This is an unlikely case, and callers just have to tolerate it.)"
+ ^ pages identityIndexOf: aMorph
- ^ pages identityIndexOf: aMorph ifAbsent: [0]
!
Item was changed:
----- Method: CommandHistory>>historyIndexOfLastCommand (in category 'command history') -----
historyIndexOfLastCommand
"Answer which position of the CommandHistory list is occupied by the LastCommand"
+ ^ history indexOf: lastCommand!
- ^ history indexOf: lastCommand ifAbsent: [0]!
Levente Uzonyi uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ul.1059.mcz
==================== Summary ====================
Name: Kernel-ul.1059
Author: ul
Time: 11 February 2017, 3:00:22.370854 am
UUID: b88b767b-b0d8-43ff-ba86-a19b11affe6d
Ancestors: Kernel-ul.1058
- check the type of the argument of #& and #| of booleans
=============== Diff against Kernel-ul.1058 ===============
Item was changed:
----- Method: False>>& (in category 'logical operations') -----
& aBoolean
+ "Evaluating conjunction -- answer false since receiver is false, but let the VM quickly check the type of the argument first."
- "Evaluating conjunction -- answer false since receiver is false."
+ aBoolean ifFalse: [ ^false ].
+ ^false!
- ^self!
Item was changed:
----- Method: False>>| (in category 'logical operations') -----
| aBoolean
+ "Evaluating disjunction (OR) -- could answer aBoolean since receiver is false, but let the VM quickly check the type of the argument instead."
- "Evaluating disjunction (OR) -- answer with the argument, aBoolean."
+ aBoolean ifTrue: [ ^true ].
+ ^false!
- ^aBoolean!
Item was changed:
----- Method: True>>& (in category 'logical operations') -----
& aBoolean
+ "Evaluating conjunction -- could answer aBoolean since receiver is true, but let the VM quickly check the type of the argument instead."
- "Evaluating conjunction -- answer aBoolean since receiver is true."
+ aBoolean ifFalse: [ ^false ].
+ ^true!
- ^aBoolean!
Item was changed:
----- Method: True>>| (in category 'logical operations') -----
| aBoolean
+ "Evaluating disjunction (OR) -- answer true since the receiver is true, but let the VM quickly check the type of the argument first."
- "Evaluating disjunction (OR) -- answer true since the receiver is true."
+ aBoolean ifTrue: [ ^true ].
+ ^true!
- ^self!
Levente Uzonyi uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-ul.369.mcz
==================== Summary ====================
Name: Graphics-ul.369
Author: ul
Time: 27 February 2017, 2:11:11.506532 am
UUID: 87cd9b87-4712-42c0-8aac-0c1095700248
Ancestors: Graphics-bf.368
- omit ifAbsent from #index* sends when the default value, 0 would used
=============== Diff against Graphics-bf.368 ===============
Item was changed:
----- Method: ColorForm>>indexOfColor: (in category 'color manipulation') -----
indexOfColor: aColor
"Return the index of aColor in my color array"
self ensureColorArrayExists.
+ ^ colors indexOf: aColor!
- ^ colors indexOf: aColor ifAbsent: [0]!