Not sure what the junk below on the commit diff is; it all looks familiar and faintly cog-related though. Do we have the dirty-inbox problem again? AFAIK I only touched three comments in this commit.<br><br><div class="gmail_quote">
On Tue, Jul 27, 2010 at 8:47 PM, <span dir="ltr"><<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
A new version of Kernel was added to project The Inbox:<br>
<a href="http://source.squeak.org/inbox/Kernel-cbr.475.mcz" target="_blank">http://source.squeak.org/inbox/Kernel-cbr.475.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Kernel-cbr.475<br>
Author: cbr<br>
Time: 27 July 2010, 8:47:17.817 pm<br>
UUID: 31fff092-aa15-4aac-9cff-0edb485a0d25<br>
Ancestors: Kernel-eem.474<br>
<br>
A few of the chronology classes met my current heuristic for "comment is too small," and though the comments were fine as is, I added an example usage to each just for fun.<br>
<br>
=============== Diff against Kernel-eem.474 ===============<br>
<br>
Item was changed:<br>
Timespan subclass: #Week<br>
instanceVariableNames: ''<br>
classVariableNames: 'StartDay'<br>
poolDictionaries: 'ChronologyConstants'<br>
category: 'Kernel-Chronology'!<br>
<br>
+ !Week commentStamp: 'cbr 7/27/2010 20:28' prior: 0!<br>
+ I represent a week.<br>
+<br>
+ To find out what days of the week on which Squeak is fun, select the following expression, and print it:<br>
+<br>
+ Week dayNames!<br>
- !Week commentStamp: 'brp 5/13/2003 09:48' prior: 0!<br>
- I represent a week.!<br>
<br>
Item was changed:<br>
Timespan subclass: #Year<br>
instanceVariableNames: ''<br>
classVariableNames: ''<br>
poolDictionaries: ''<br>
category: 'Kernel-Chronology'!<br>
<br>
+ !Year commentStamp: 'cbr 7/27/2010 20:41' prior: 0!<br>
+ I represent a year.<br>
+<br>
+ Try me!! Select the following expression and print it:<br>
+<br>
+ Year current daysInYear "Try me again next leap year!!"!<br>
- !Year commentStamp: 'dtl 7/11/2009 16:35' prior: 0!<br>
- I represent a year.!<br>
<br>
Item was changed:<br>
Timespan subclass: #Month<br>
instanceVariableNames: ''<br>
classVariableNames: ''<br>
poolDictionaries: 'ChronologyConstants'<br>
category: 'Kernel-Chronology'!<br>
<br>
+ !Month commentStamp: 'cbr 7/27/2010 20:34' prior: 0!<br>
+ I represent a month.<br>
+<br>
+ For example, to get the number of days this month, you can evaluate the following expression:<br>
+<br>
+ Month current daysInMonth!<br>
- !Month commentStamp: 'brp 5/13/2003 09:48' prior: 0!<br>
- I represent a month.!<br>
<br>
Item was removed:<br>
- ----- Method: Integer>>isPrime (in category 'testing') -----<br>
- isPrime<br>
- "Answer true if the receiver is a prime number. See isProbablyPrime for a probabilistic<br>
- implementation that is much faster for large integers, and that is correct to an extremely<br>
- high statistical level of confidence (effectively deterministic)."<br>
-<br>
- self <= 1 ifTrue: [ ^false ].<br>
- self even ifTrue: [ ^self = 2].<br>
- 3 to: self sqrtFloor by: 2 do: [ :each |<br>
- self \\ each = 0 ifTrue: [ ^false ] ].<br>
- ^true!<br>
<br>
Item was removed:<br>
- ----- Method: Float class>>twoPi (in category 'constants') -----<br>
- twoPi<br>
-<br>
- ^ Twopi<br>
- !<br>
<br>
Item was removed:<br>
- ----- Method: Integer>>isProbablyPrimeWithK:andQ: (in category 'private') -----<br>
- isProbablyPrimeWithK: k andQ: q<br>
- "Algorithm P, probabilistic primality test, from<br>
- Knuth, Donald E. 'The Art of Computer Programming', Vol 2,<br>
- Third Edition, section 4.5.4, page 395, P1-P5 refer to Knuth description."<br>
-<br>
- "P1"<br>
-<br>
- | x j y |<br>
- x := (self - 2) atRandom + 1.<br>
- "P2"<br>
- j := 0.<br>
- y := x raisedToInteger: q modulo: self.<br>
- "P3"<br>
-<br>
- [(((j = 0) & (y = 1)) | (y = (self - 1))) ifTrue: [^true].<br>
- ((j > 0) & (y = 1)) ifTrue: [^false]. "P5"<br>
- true]<br>
- whileTrue:<br>
- [j := j + 1.<br>
- (j < k) ifTrue: [y := y squared \\ self]<br>
- ifFalse:[^ false]]!<br>
<br>
Item was removed:<br>
- ----- Method: Object>>isArray (in category 'testing') -----<br>
- isArray<br>
- ^false!<br>
<br>
Item was removed:<br>
- ----- Method: Integer>>raisedToInteger:modulo: (in category 'mathematical functions') -----<br>
- raisedToInteger: exp modulo: m<br>
- (exp = 0) ifTrue: [^ 1].<br>
- exp even<br>
- ifTrue: [^ (self raisedToInteger: (exp // 2) modulo: m) squared \\ m]<br>
- ifFalse: [^ (self * (self raisedToInteger: (exp - 1) modulo: m)) \\ m].!<br>
<br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>Casey Ransberger<br>