Chris Muller uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-cmm.814.mcz
==================== Summary ====================
Name: Kernel-cmm.814
Author: cmm
Time: 25 October 2013, 2:27:37.722 pm
UUID: c757a2a8-26b1-422b-8b8b-4bf6640efbb4
Ancestors: Kernel-cmm.813
Added BlockClosure>>#valueWithAllPossibleArguments: to support passing a variable number of arguments to the image from the command-line.
=============== Diff against Kernel-cmm.813 ===============
Item was changed:
+ ----- Method: BlockClosure>>valueOtherwise: (in category 'evaluating') -----
- ----- Method: BlockClosure>>valueOtherwise: (in category 'events-support') -----
valueOtherwise: aBlock
"Send the message and answer the return value"
^self value!
Item was added:
+ ----- Method: BlockClosure>>valueWithAllPossibleArguments: (in category 'evaluating') -----
+ valueWithAllPossibleArguments: anArray
+ "Same as valueWithPossibleArgs: except when the receiver takes just one-argument, and more than one argument is specified by anArray, then pass all of anArray as THE argument to the receiver block
+ This is used to allow a large, variable number of arguments to be passed."
+ ^numArgs = 0
+ ifTrue: [self value]
+ ifFalse:
+ [self valueWithArguments:
+ (numArgs = anArray size
+ ifTrue: [anArray]
+ ifFalse:
+ [numArgs > anArray size
+ ifTrue: [anArray, (Array new: numArgs - anArray size)]
+ ifFalse:
+ [numArgs = 1
+ ifTrue: [Array with: anArray]
+ ifFalse: [anArray copyFrom: 1 to: numArgs]]])]!
Item was changed:
+ ----- Method: BlockClosure>>valueWithArguments:otherwise: (in category 'evaluating') -----
- ----- Method: BlockClosure>>valueWithArguments:otherwise: (in category 'events-support') -----
valueWithArguments: anArray otherwise: aBlock
^ self valueWithArguments: anArray!
Item was changed:
+ ----- Method: BlockClosure>>valueWithEnoughArguments: (in category 'evaluating') -----
- ----- Method: BlockClosure>>valueWithEnoughArguments: (in category 'events-support') -----
valueWithEnoughArguments: anArray
"call me with enough arguments from anArray"
| args |
(anArray size == self numArgs)
ifTrue: [ ^self valueWithArguments: anArray ].
args := Array new: self numArgs.
args replaceFrom: 1
to: (anArray size min: args size)
with: anArray
startingAt: 1.
^ self valueWithArguments: args!
A new version of Kernel was added to project The Inbox:
http://source.squeak.org/inbox/Kernel-cmm.814.mcz
==================== Summary ====================
Name: Kernel-cmm.814
Author: cmm
Time: 25 October 2013, 2:27:37.722 pm
UUID: c757a2a8-26b1-422b-8b8b-4bf6640efbb4
Ancestors: Kernel-cmm.813
Added BlockClosure>>#valueWithAllPossibleArguments: to support passing a variable number of arguments to the image from the command-line.
=============== Diff against Kernel-cmm.813 ===============
Item was changed:
+ ----- Method: BlockClosure>>valueOtherwise: (in category 'evaluating') -----
- ----- Method: BlockClosure>>valueOtherwise: (in category 'events-support') -----
valueOtherwise: aBlock
"Send the message and answer the return value"
^self value!
Item was added:
+ ----- Method: BlockClosure>>valueWithAllPossibleArguments: (in category 'evaluating') -----
+ valueWithAllPossibleArguments: anArray
+ "Same as valueWithPossibleArgs: except when the receiver takes just one-argument, and more than one argument is specified by anArray, then pass all of anArray as THE argument to the receiver block
+ This is used to allow a large, variable number of arguments to be passed."
+ ^numArgs = 0
+ ifTrue: [self value]
+ ifFalse:
+ [self valueWithArguments:
+ (numArgs = anArray size
+ ifTrue: [anArray]
+ ifFalse:
+ [numArgs > anArray size
+ ifTrue: [anArray, (Array new: numArgs - anArray size)]
+ ifFalse:
+ [numArgs = 1
+ ifTrue: [Array with: anArray]
+ ifFalse: [anArray copyFrom: 1 to: numArgs]]])]!
Item was changed:
+ ----- Method: BlockClosure>>valueWithArguments:otherwise: (in category 'evaluating') -----
- ----- Method: BlockClosure>>valueWithArguments:otherwise: (in category 'events-support') -----
valueWithArguments: anArray otherwise: aBlock
^ self valueWithArguments: anArray!
Item was changed:
+ ----- Method: BlockClosure>>valueWithEnoughArguments: (in category 'evaluating') -----
- ----- Method: BlockClosure>>valueWithEnoughArguments: (in category 'events-support') -----
valueWithEnoughArguments: anArray
"call me with enough arguments from anArray"
| args |
(anArray size == self numArgs)
ifTrue: [ ^self valueWithArguments: anArray ].
args := Array new: self numArgs.
args replaceFrom: 1
to: (anArray size min: args size)
with: anArray
startingAt: 1.
^ self valueWithArguments: args!
I just came across SmalltalkImage>>#saveAsEmbeddedImage. The comment
for the method states:
"Save the current state of the system as an embedded image"
Brilliant!
Could someone please elaborate for me?
testRevertMostRecentRemovesLatestVersion is still failing -- could use
a little help on that one.
On Fri, Oct 25, 2013 at 10:41 AM, <commits(a)source.squeak.org> wrote:
> Chris Muller uploaded a new version of System to project The Trunk:
> http://source.squeak.org/trunk/System-cmm.606.mcz
>
> ==================== Summary ====================
>
> Name: System-cmm.606
> Author: cmm
> Time: 25 October 2013, 10:41:38.197 am
> UUID: 6a901946-a756-42d8-a453-f727b8dfad32
> Ancestors: System-dtl.605
>
> - Correct initialization of RecentMessages in case a new instance is ever made (and for the test cases).
> - Fix revertMostRecent.
>
> =============== Diff against System-dtl.605 ===============
>
> Item was changed:
> ----- Method: RecentMessages>>initialize (in category 'initialize-release') -----
> initialize
> super initialize.
> + methodReferences := OrderedCollection new: (maximumSubmissionCount := 30).
> + isSuspended := false!
> - methodReferences := OrderedCollection new: 30!
>
> Item was changed:
> ----- Method: RecentMessages>>revertMostRecent (in category 'accessing') -----
> revertMostRecent
> "If the most recent method submission was a method change, revert
> that change, and if it was a submission of a brand-new method,
> remove that method."
> | changeRecords lastSubmission theClass theSelector |
> methodReferences ifEmpty: [ ^ Beeper beep ].
> + lastSubmission := self mostRecent.
> - lastSubmission := methodReferences last.
> theClass := lastSubmission actualClass ifNil: [ ^ Beeper beep ].
> theSelector := lastSubmission methodSymbol.
> changeRecords := theClass changeRecordsAt: theSelector.
> changeRecords isEmptyOrNil ifTrue: [ ^ Beeper beep ].
> changeRecords size = 1
> ifTrue: [ "method has no prior version, so reverting in this case means removing"
> theClass removeSelector: theSelector ]
> ifFalse: [ changeRecords second fileIn ]
> !
>
>
Levente Uzonyi uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-ul.607.mcz
==================== Summary ====================
Name: System-ul.607
Author: ul
Time: 25 October 2013, 6:47:30.844 pm
UUID: 5d2174eb-547d-44d1-8466-98c855eff27e
Ancestors: System-cmm.606
ChangeRecord >> #fileIn: must use the environment to look up the methodClass.
RecentMessages >> #revertMostRecent must pass the environment to the changeRecord, otherwise it can't be filed in.
=============== Diff against System-cmm.606 ===============
Item was changed:
----- Method: ChangeRecord>>fileIn: (in category 'initialization') -----
fileIn: anEnvironment
"File the receiver in. If I represent a method or a class-comment, file the method in and make a note of it in the recent-submissions list; if I represent a do-it, then, well, do it; if I represent a reorganization then get organized!!"
Cursor read showWhile:
[| s cls aSelector |
type == #doIt
ifTrue:
[((s := self string) beginsWith: '----') ifFalse: [Compiler evaluate: s]]
ifFalse:
+ [cls := self methodClass: anEnvironment.
- [cls := self methodClass.
type == #method ifTrue:
[[cls compile: self text classified: category withStamp: stamp notifying: nil]
on: EnvironmentRequest do: [:e | e resume: anEnvironment].
(aSelector := self methodSelector) ifNotNil:
[RecentMessages default recordSelector: aSelector forClass: cls inEnvironment: anEnvironment]].
type == #classComment ifTrue:
[cls comment: self text stamp: stamp.
RecentMessages default recordSelector: #Comment forClass: cls inEnvironment: anEnvironment].
type == #reorganize ifTrue:
[cls organization changeFromString: self text]]]!
Item was changed:
----- Method: RecentMessages>>revertMostRecent (in category 'accessing') -----
revertMostRecent
"If the most recent method submission was a method change, revert
that change, and if it was a submission of a brand-new method,
remove that method."
| changeRecords lastSubmission theClass theSelector |
methodReferences ifEmpty: [ ^ Beeper beep ].
lastSubmission := self mostRecent.
theClass := lastSubmission actualClass ifNil: [ ^ Beeper beep ].
theSelector := lastSubmission methodSymbol.
changeRecords := theClass changeRecordsAt: theSelector.
changeRecords isEmptyOrNil ifTrue: [ ^ Beeper beep ].
changeRecords size = 1
ifTrue: [ "method has no prior version, so reverting in this case means removing"
theClass removeSelector: theSelector ]
+ ifFalse: [ changeRecords second fileIn: lastSubmission environment ]
- ifFalse: [ changeRecords second fileIn ]
!