The Trunk: Kernel-ul.704.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Kernel-ul.704.mcz

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

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

Name: Kernel-ul.704
Author: ul
Time: 5 July 2012, 11:22:10.913 am
UUID: 224efcec-9920-7b4f-9fad-46ae9554a560
Ancestors: Kernel-eem.703, Kernel-cmm.701

Merged. Every package should have one head version in the Trunk.

=============== Diff against Kernel-eem.703 ===============

Item was changed:
  ----- Method: DateAndTime class>>nowWithOffset: (in category 'squeak protocol') -----
+ nowWithOffset: aDuration
- nowWithOffset: aDuration
  | nanoTicks msm |
-
  nanoTicks := (msm := self milliSecondsSinceMidnight) * 1000000.
+ "The following usually only executes at system startup."
+ ^ LastTick < nanoTicks
+ ifTrue:
+ [ LastTick := nanoTicks.
+ self waitForOffsets.
+ self basicNew
+ setJdn: DaysSinceEpoch
+ seconds: msm // 1000
+ nano: msm \\ 1000 * 1000000
+ offset: aDuration ]
+ ifFalse:
+ [ LastTickSemaphore critical:
+ [ LastTick := LastTick + 1.
+ self waitForOffsets.
+ self basicNew
+ setJdn: DaysSinceEpoch
+ seconds: LastTick // 1000000000
+ nano: LastTick \\ 1000000000
+ offset: aDuration ] ]
-
- (LastTick < nanoTicks) ifTrue: [
- LastTick := nanoTicks.
- ^ self todayAtMilliSeconds: msm offset: aDuration].
-
- LastTickSemaphore critical: [
- LastTick :=  LastTick + 1.
- ^ self todayAtNanoSeconds: LastTick offset: aDuration]
-
  "
  [ 10000 timesRepeat: [ self now. ] ] timeToRun / 10000.0 .
 
  If calls to DateAndTime-c-#now are within a single millisecond the semaphore code
  to ensure that (self now <= self now) slows things down considerably by a factor of about 20.
 
  The actual speed of a single call to DateAndTime-now in milliseconds is
  demonstrated by the unguarded method below.
 
  [ 100000 timesRepeat: [ self todayAtMilliSeconds: (self milliSecondsSinceMidnight) ] ] timeToRun / 100000.0 .  0.00494 0.00481 0.00492 0.00495
   
  "!

Item was removed:
- ----- Method: DateAndTime class>>todayAtMilliSeconds: (in category 'squeak protocol') -----
- todayAtMilliSeconds: milliSecondsSinceMidnight
- self deprecated: 'Use todayAtMilliSeconds:offset:.'.
- ^ self
- todayAtMilliSeconds: milliSecondsSinceMidnight
- offset: self localOffset!

Item was removed:
- ----- Method: DateAndTime class>>todayAtMilliSeconds:offset: (in category 'squeak protocol') -----
- todayAtMilliSeconds: milliSecondsSinceMidnight offset: aDuration
-
- "This is usually only during system startup..."
- self waitForOffsets.
-
- ^ self basicNew
- setJdn: DaysSinceEpoch
- seconds: (milliSecondsSinceMidnight // 1000)
- nano: (milliSecondsSinceMidnight  \\ 1000 * 1000000  )
- offset: aDuration
-
- "
- [ 100000 timesRepeat: [ self fromMilliSeconds: self milliSecondsSinceMidnight. ] ] timeToRun.
- "!

Item was removed:
- ----- Method: DateAndTime class>>todayAtNanoSeconds: (in category 'squeak protocol') -----
- todayAtNanoSeconds: nanoSecondsSinceMidnight
- self deprecated: 'Use todayAtNanoSeconds:offset:.'.
- self
- todayAtNanoSeconds: nanoSecondsSinceMidnight
- offset: self localOffset!

Item was removed:
- ----- Method: DateAndTime class>>todayAtNanoSeconds:offset: (in category 'squeak protocol') -----
- todayAtNanoSeconds: nanoSecondsSinceMidnight offset: aDuration
-
- "This is usually only during system startup..."
- self waitForOffsets.
-
- ^ self basicNew
- setJdn: DaysSinceEpoch
- seconds: (nanoSecondsSinceMidnight // 1000000000)
- nano: (nanoSecondsSinceMidnight  \\ 1000000000  )
- offset: aDuration
-  !

Item was changed:
  ----- Method: Integer>>asStringWithCommas (in category 'printing') -----
  asStringWithCommas
  "123456789 asStringWithCommas"
  "-123456789 asStringWithCommas"
+ ^ self asStringWithCommasSigned: false!
- | digits |
- digits := self abs printString.
- ^ String streamContents:
- [:strm |
- self sign = -1 ifTrue: [strm nextPut: $-].
- 1 to: digits size do:
- [:i | strm nextPut: (digits at: i).
- (i < digits size and: [(i - digits size) \\ 3 = 0])
- ifTrue: [strm nextPut: $,]]]!

Item was changed:
  ----- Method: Integer>>asStringWithCommasSigned (in category 'printing') -----
  asStringWithCommasSigned
  "123456789 asStringWithCommasSigned"
  "-123456789 asStringWithCommasSigned"
  | digits |
+ self deprecated: 'Use #asStringWithCommasSigned:'.
  digits := self abs printString.
  ^ String streamContents:
  [:strm |
  self sign = -1 ifTrue: [strm nextPut: $-] ifFalse:[strm nextPut: $+].
  1 to: digits size do:
  [:i | strm nextPut: (digits at: i).
  (i < digits size and: [(i - digits size) \\ 3 = 0])
  ifTrue: [strm nextPut: $,]]]!

Item was added:
+ ----- Method: Integer>>asStringWithCommasSigned: (in category 'printing') -----
+ asStringWithCommasSigned: aBoolean
+ "123456789 asStringWithCommasSigned: true"
+ "-123456789 asStringWithCommasSigned: false"
+ | digits |
+ digits := self abs printString.
+ ^ String streamContents:
+ [:strm |
+ self sign = -1 ifTrue: [strm nextPut: $-] ifFalse: [aBoolean ifTrue: [strm nextPut: $+]].
+ 1 to: digits size do:
+ [:i | strm nextPut: (digits at: i).
+ (i < digits size and: [(i - digits size) \\ 3 = 0])
+ ifTrue: [strm nextPut: $,]]]!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-ul.704.mcz

Chris Muller-3
Hm, strange.  The whole purpose of my 701 was to be the latest merged
head -- I thought my repository list was refreshed I guess it wasn't..

On Thu, Jul 5, 2012 at 9:28 AM,  <[hidden email]> wrote:

> Levente Uzonyi uploaded a new version of Kernel to project The Trunk:
> http://source.squeak.org/trunk/Kernel-ul.704.mcz
>
> ==================== Summary ====================
>
> Name: Kernel-ul.704
> Author: ul
> Time: 5 July 2012, 11:22:10.913 am
> UUID: 224efcec-9920-7b4f-9fad-46ae9554a560
> Ancestors: Kernel-eem.703, Kernel-cmm.701
>
> Merged. Every package should have one head version in the Trunk.
>
> =============== Diff against Kernel-eem.703 ===============
>
> Item was changed:
>   ----- Method: DateAndTime class>>nowWithOffset: (in category 'squeak protocol') -----
> + nowWithOffset: aDuration
> - nowWithOffset: aDuration
>         | nanoTicks msm |
> -
>         nanoTicks := (msm := self milliSecondsSinceMidnight) * 1000000.
> +       "The following usually only executes at system startup."
> +       ^ LastTick < nanoTicks
> +               ifTrue:
> +                       [ LastTick := nanoTicks.
> +                       self waitForOffsets.
> +                       self basicNew
> +                               setJdn: DaysSinceEpoch
> +                               seconds: msm // 1000
> +                               nano: msm \\ 1000 * 1000000
> +                               offset: aDuration ]
> +               ifFalse:
> +                       [ LastTickSemaphore critical:
> +                               [ LastTick := LastTick + 1.
> +                               self waitForOffsets.
> +                               self basicNew
> +                                       setJdn: DaysSinceEpoch
> +                                       seconds: LastTick // 1000000000
> +                                       nano: LastTick \\ 1000000000
> +                                       offset: aDuration ] ]
> -
> -       (LastTick < nanoTicks) ifTrue: [
> -               LastTick := nanoTicks.
> -               ^ self todayAtMilliSeconds: msm offset: aDuration].
> -
> -       LastTickSemaphore critical: [
> -               LastTick :=  LastTick + 1.
> -               ^ self todayAtNanoSeconds: LastTick offset: aDuration]
> -
>   "
>   [ 10000 timesRepeat: [ self now. ] ] timeToRun / 10000.0 .
>
>   If calls to DateAndTime-c-#now are within a single millisecond the semaphore code
>   to ensure that (self now <= self now) slows things down considerably by a factor of about 20.
>
>   The actual speed of a single call to DateAndTime-now in milliseconds is
>   demonstrated by the unguarded method below.
>
>   [ 100000 timesRepeat: [ self todayAtMilliSeconds: (self milliSecondsSinceMidnight) ] ] timeToRun / 100000.0 .  0.00494 0.00481 0.00492 0.00495
>
>   "!
>
> Item was removed:
> - ----- Method: DateAndTime class>>todayAtMilliSeconds: (in category 'squeak protocol') -----
> - todayAtMilliSeconds: milliSecondsSinceMidnight
> - self deprecated: 'Use todayAtMilliSeconds:offset:.'.
> -       ^ self
> -               todayAtMilliSeconds: milliSecondsSinceMidnight
> -               offset: self localOffset!
>
> Item was removed:
> - ----- Method: DateAndTime class>>todayAtMilliSeconds:offset: (in category 'squeak protocol') -----
> - todayAtMilliSeconds: milliSecondsSinceMidnight offset: aDuration
> -
> -       "This is usually only during system startup..."
> -       self waitForOffsets.
> -
> -        ^ self basicNew
> -                       setJdn: DaysSinceEpoch
> -                       seconds: (milliSecondsSinceMidnight // 1000)
> -                       nano: (milliSecondsSinceMidnight  \\ 1000 * 1000000  )
> -                       offset: aDuration
> -
> - "
> - [ 100000 timesRepeat: [ self fromMilliSeconds: self milliSecondsSinceMidnight. ] ] timeToRun.
> - "!
>
> Item was removed:
> - ----- Method: DateAndTime class>>todayAtNanoSeconds: (in category 'squeak protocol') -----
> - todayAtNanoSeconds: nanoSecondsSinceMidnight
> - self deprecated: 'Use todayAtNanoSeconds:offset:.'.
> -       self
> -               todayAtNanoSeconds: nanoSecondsSinceMidnight
> -               offset: self localOffset!
>
> Item was removed:
> - ----- Method: DateAndTime class>>todayAtNanoSeconds:offset: (in category 'squeak protocol') -----
> - todayAtNanoSeconds: nanoSecondsSinceMidnight offset: aDuration
> -
> -       "This is usually only during system startup..."
> -       self waitForOffsets.
> -
> -       ^ self basicNew
> -                       setJdn: DaysSinceEpoch
> -                       seconds: (nanoSecondsSinceMidnight // 1000000000)
> -                       nano: (nanoSecondsSinceMidnight  \\ 1000000000  )
> -                       offset: aDuration
> -  !
>
> Item was changed:
>   ----- Method: Integer>>asStringWithCommas (in category 'printing') -----
>   asStringWithCommas
>         "123456789 asStringWithCommas"
>         "-123456789 asStringWithCommas"
> +       ^ self asStringWithCommasSigned: false!
> -       | digits |
> -       digits := self abs printString.
> -       ^ String streamContents:
> -               [:strm |
> -               self sign = -1 ifTrue: [strm nextPut: $-].
> -               1 to: digits size do:
> -                       [:i | strm nextPut: (digits at: i).
> -                       (i < digits size and: [(i - digits size) \\ 3 = 0])
> -                               ifTrue: [strm nextPut: $,]]]!
>
> Item was changed:
>   ----- Method: Integer>>asStringWithCommasSigned (in category 'printing') -----
>   asStringWithCommasSigned
>         "123456789 asStringWithCommasSigned"
>         "-123456789 asStringWithCommasSigned"
>         | digits |
> + self deprecated: 'Use #asStringWithCommasSigned:'.
>         digits := self abs printString.
>         ^ String streamContents:
>                 [:strm |
>                 self sign = -1 ifTrue: [strm nextPut: $-] ifFalse:[strm nextPut: $+].
>                 1 to: digits size do:
>                         [:i | strm nextPut: (digits at: i).
>                         (i < digits size and: [(i - digits size) \\ 3 = 0])
>                                 ifTrue: [strm nextPut: $,]]]!
>
> Item was added:
> + ----- Method: Integer>>asStringWithCommasSigned: (in category 'printing') -----
> + asStringWithCommasSigned: aBoolean
> +       "123456789 asStringWithCommasSigned: true"
> +       "-123456789 asStringWithCommasSigned: false"
> +       | digits |
> +       digits := self abs printString.
> +       ^ String streamContents:
> +               [:strm |
> +               self sign = -1 ifTrue: [strm nextPut: $-] ifFalse: [aBoolean ifTrue: [strm nextPut: $+]].
> +               1 to: digits size do:
> +                       [:i | strm nextPut: (digits at: i).
> +                       (i < digits size and: [(i - digits size) \\ 3 = 0])
> +                               ifTrue: [strm nextPut: $,]]]!
>
>