[Pkg] The Trunk: Kernel-bf.998.mcz
commits at source.squeak.org
commits at source.squeak.org
Fri Feb 19 00:34:46 UTC 2016
Bert Freudenberg uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-bf.998.mcz
==================== Summary ====================
Name: Kernel-bf.998
Author: bf
Time: 18 February 2016, 4:34:20.797046 pm
UUID: f7674529-7b17-4eb4-ba65-d4ac0d6e262f
Ancestors: Kernel-bf.997
Fix underscore assignments
=============== Diff against Kernel-bf.997 ===============
Item was changed:
----- Method: DateAndTime>>< (in category 'ansi protocol') -----
< comparand
"comparand conforms to protocol DateAndTime,
or can be converted into something that conforms."
| lvalue rvalue comparandAsDateAndTime |
comparandAsDateAndTime _ comparand asDateAndTime.
self offset = comparandAsDateAndTime offset
ifTrue:
+ [ lvalue := self.
+ rvalue := comparandAsDateAndTime ]
- [ lvalue _ self.
- rvalue _ comparandAsDateAndTime ]
ifFalse:
+ [ lvalue := self asUTC.
+ rvalue := comparandAsDateAndTime asUTC ].
- [ lvalue _ self asUTC.
- rvalue _ comparandAsDateAndTime asUTC ].
^ lvalue julianDayNumber < rvalue julianDayNumber or:
[ lvalue julianDayNumber > rvalue julianDayNumber
ifTrue: [ false ]
ifFalse:
[ lvalue secondsSinceMidnight < rvalue secondsSinceMidnight or:
[ lvalue secondsSinceMidnight > rvalue secondsSinceMidnight
ifTrue: [ false ]
ifFalse: [ lvalue nanoSecond < rvalue nanoSecond ] ] ] ]!
Item was changed:
----- Method: DateAndTime>>hash (in category 'ansi protocol') -----
hash
| totalSeconds |
+ totalSeconds := seconds - self offset asSeconds.
- totalSeconds _ seconds - self offset asSeconds.
^ ((totalSeconds // 86400 + jdn) hashMultiply bitXor: totalSeconds \\
86400) bitXor: nanos!
Item was changed:
----- Method: DateAndTime>>printOn:withLeadingSpace: (in category 'squeak protocol') -----
printOn: aStream withLeadingSpace: printLeadingSpaceToo
"Print as per ISO 8601 sections 5.3.3 and 5.4.1.
If printLeadingSpaceToo is false, prints either:
'YYYY-MM-DDThh:mm:ss.s+ZZ:zz:z' (for positive years) or '-YYYY-MM-DDThh:mm:ss.s+ZZ:zz:z' (for negative years)
If printLeadingSpaceToo is true, prints either:
' YYYY-MM-DDThh:mm:ss.s+ZZ:zz:z' (for positive years) or '-YYYY-MM-DDThh:mm:ss.s+ZZ:zz:z' (for negative years)
"
self printYMDOn: aStream withLeadingSpace: printLeadingSpaceToo.
aStream nextPut: $T.
self printHMSOn: aStream.
self nanoSecond ~= 0 ifTrue:
[ | z ps |
+ ps := self nanoSecond printString padded: #left to: 9 with: $0.
+ z := ps findLast: [ :c | c asciiValue > $0 asciiValue ].
- ps _ self nanoSecond printString padded: #left to: 9 with: $0.
- z _ ps findLast: [ :c | c asciiValue > $0 asciiValue ].
(z > 0) ifTrue: [aStream nextPut: $.].
ps from: 1 to: z do: [ :c | aStream nextPut: c ] ].
aStream
nextPut: (self offset positive ifTrue: [$+] ifFalse: [$-]);
nextPutAll: (self offset hours abs asString padded: #left to: 2 with: $0);
nextPut: $:;
nextPutAll: (self offset minutes abs asString padded: #left to: 2 with: $0).
self offset seconds = 0 ifFalse:
[ aStream
nextPut: $:;
nextPutAll: (self offset seconds abs truncated asString) ].
!
More information about the Packages
mailing list