A new version of MonticelloConfigurations was added to project The Inbox:
http://source.squeak.org/inbox/MonticelloConfigurations-cmm.116.mcz ==================== Summary ==================== Name: MonticelloConfigurations-cmm.116 Author: cmm Time: 8 October 2013, 11:17:41.275 am UUID: 7fc9bf79-f791-4d78-adb8-beddd88b90bd Ancestors: MonticelloConfigurations-bf.115 Persist MCConfiguration's 'name'. =============== Diff against MonticelloConfigurations-bf.115 =============== Item was changed: ----- Method: MCConfiguration class>>fromArray: (in category 'instance creation') ----- fromArray: anArray | configuration | configuration := self new. anArray pairsDo: [:key :value | key = #repository ifTrue: [configuration repositories add: (self repositoryFromArray: value)]. key = #dependency ifTrue: [configuration dependencies add: (self dependencyFromArray: value)]. + key = #name + ifTrue: [configuration name: value]. ]. ^configuration! Item was removed: - ----- Method: MCMcmReader>>configurationName (in category 'accessing') ----- - configurationName - ^fileName ifNotNil: [(fileName findTokens: '/\:') last copyUpToLast: $.]! Item was changed: ----- Method: MCMcmReader>>loadConfiguration (in category 'accessing') ----- loadConfiguration stream reset. configuration := MCConfiguration fromArray: (MCScanner scan: stream). + configuration name ifNil: [ configuration name: self parseNameFromFilename ]! - configuration name: self configurationName. - ! Item was added: + ----- Method: MCMcmReader>>parseNameFromFilename (in category 'accessing') ----- + parseNameFromFilename + ^fileName ifNotNil: [(fileName findTokens: '/\:') last copyUpToLast: $.]! Item was changed: ----- Method: MCMcmWriter>>writeConfiguration: (in category 'writing') ----- writeConfiguration: aConfiguration stream nextPut: $(. aConfiguration repositories do: [:ea | stream cr. stream nextPutAll: 'repository '. (MCConfiguration repositoryToArray: ea) printElementsOn: stream]. aConfiguration dependencies do: [:ea | stream cr. stream nextPutAll: 'dependency '. (MCConfiguration dependencyToArray: ea) printElementsOn: stream]. + stream nextPutAll: 'name '; nextPutAll: aConfiguration name printString. + stream cr. stream nextPut: $). stream cr.! |
Will move this to trunk soon.
On Tue, Oct 8, 2013 at 11:17 AM, <[hidden email]> wrote: > A new version of MonticelloConfigurations was added to project The Inbox: > http://source.squeak.org/inbox/MonticelloConfigurations-cmm.116.mcz > > ==================== Summary ==================== > > Name: MonticelloConfigurations-cmm.116 > Author: cmm > Time: 8 October 2013, 11:17:41.275 am > UUID: 7fc9bf79-f791-4d78-adb8-beddd88b90bd > Ancestors: MonticelloConfigurations-bf.115 > > Persist MCConfiguration's 'name'. > > =============== Diff against MonticelloConfigurations-bf.115 =============== > > Item was changed: > ----- Method: MCConfiguration class>>fromArray: (in category 'instance creation') ----- > fromArray: anArray > | configuration | > configuration := self new. > anArray pairsDo: [:key :value | > key = #repository > ifTrue: [configuration repositories add: (self repositoryFromArray: value)]. > key = #dependency > ifTrue: [configuration dependencies add: (self dependencyFromArray: value)]. > + key = #name > + ifTrue: [configuration name: value]. > ]. > ^configuration! > > Item was removed: > - ----- Method: MCMcmReader>>configurationName (in category 'accessing') ----- > - configurationName > - ^fileName ifNotNil: [(fileName findTokens: '/\:') last copyUpToLast: $.]! > > Item was changed: > ----- Method: MCMcmReader>>loadConfiguration (in category 'accessing') ----- > loadConfiguration > stream reset. > configuration := MCConfiguration fromArray: (MCScanner scan: stream). > + configuration name ifNil: [ configuration name: self parseNameFromFilename ]! > - configuration name: self configurationName. > - ! > > Item was added: > + ----- Method: MCMcmReader>>parseNameFromFilename (in category 'accessing') ----- > + parseNameFromFilename > + ^fileName ifNotNil: [(fileName findTokens: '/\:') last copyUpToLast: $.]! > > Item was changed: > ----- Method: MCMcmWriter>>writeConfiguration: (in category 'writing') ----- > writeConfiguration: aConfiguration > > stream nextPut: $(. > > aConfiguration repositories do: [:ea | > stream cr. > stream nextPutAll: 'repository '. > (MCConfiguration repositoryToArray: ea) printElementsOn: stream]. > > aConfiguration dependencies do: [:ea | > stream cr. > stream nextPutAll: 'dependency '. > (MCConfiguration dependencyToArray: ea) printElementsOn: stream]. > > + stream nextPutAll: 'name '; nextPutAll: aConfiguration name printString. > + > stream cr. > stream nextPut: $). > stream cr.! > > |
In reply to this post by commits-2
On 8 October 2013 17:17, <[hidden email]> wrote:
> A new version of MonticelloConfigurations was added to project The Inbox: > http://source.squeak.org/inbox/MonticelloConfigurations-cmm.116.mcz > > ==================== Summary ==================== > > Name: MonticelloConfigurations-cmm.116 > Author: cmm > Time: 8 October 2013, 11:17:41.275 am > UUID: 7fc9bf79-f791-4d78-adb8-beddd88b90bd > Ancestors: MonticelloConfigurations-bf.115 > > Persist MCConfiguration's 'name'. > > =============== Diff against MonticelloConfigurations-bf.115 =============== > > Item was changed: > ----- Method: MCConfiguration class>>fromArray: (in category 'instance creation') ----- > fromArray: anArray > | configuration | > configuration := self new. > anArray pairsDo: [:key :value | > key = #repository > ifTrue: [configuration repositories add: (self repositoryFromArray: value)]. > key = #dependency > ifTrue: [configuration dependencies add: (self dependencyFromArray: value)]. > + key = #name > + ifTrue: [configuration name: value]. This looks like a good candidate for a #caseOf:. frank |
On Tue, Oct 08, 2013 at 06:20:48PM +0100, Frank Shearar wrote:
> On 8 October 2013 17:17, <[hidden email]> wrote: > > A new version of MonticelloConfigurations was added to project The Inbox: > > http://source.squeak.org/inbox/MonticelloConfigurations-cmm.116.mcz > > > > ==================== Summary ==================== > > > > Name: MonticelloConfigurations-cmm.116 > > Author: cmm > > Time: 8 October 2013, 11:17:41.275 am > > UUID: 7fc9bf79-f791-4d78-adb8-beddd88b90bd > > Ancestors: MonticelloConfigurations-bf.115 > > > > Persist MCConfiguration's 'name'. > > > > =============== Diff against MonticelloConfigurations-bf.115 =============== > > > > Item was changed: > > ----- Method: MCConfiguration class>>fromArray: (in category 'instance creation') ----- > > fromArray: anArray > > | configuration | > > configuration := self new. > > anArray pairsDo: [:key :value | > > key = #repository > > ifTrue: [configuration repositories add: (self repositoryFromArray: value)]. > > key = #dependency > > ifTrue: [configuration dependencies add: (self dependencyFromArray: value)]. > > + key = #name > > + ifTrue: [configuration name: value]. > > This looks like a good candidate for a #caseOf:. > Woohoo! It's the official start of our annual "caseOf is not object-oriented" flame war! Let the festivities begin :-) Dave |
On 8 October 2013 18:35, David T. Lewis <[hidden email]> wrote:
> On Tue, Oct 08, 2013 at 06:20:48PM +0100, Frank Shearar wrote: >> On 8 October 2013 17:17, <[hidden email]> wrote: >> > A new version of MonticelloConfigurations was added to project The Inbox: >> > http://source.squeak.org/inbox/MonticelloConfigurations-cmm.116.mcz >> > >> > ==================== Summary ==================== >> > >> > Name: MonticelloConfigurations-cmm.116 >> > Author: cmm >> > Time: 8 October 2013, 11:17:41.275 am >> > UUID: 7fc9bf79-f791-4d78-adb8-beddd88b90bd >> > Ancestors: MonticelloConfigurations-bf.115 >> > >> > Persist MCConfiguration's 'name'. >> > >> > =============== Diff against MonticelloConfigurations-bf.115 =============== >> > >> > Item was changed: >> > ----- Method: MCConfiguration class>>fromArray: (in category 'instance creation') ----- >> > fromArray: anArray >> > | configuration | >> > configuration := self new. >> > anArray pairsDo: [:key :value | >> > key = #repository >> > ifTrue: [configuration repositories add: (self repositoryFromArray: value)]. >> > key = #dependency >> > ifTrue: [configuration dependencies add: (self dependencyFromArray: value)]. >> > + key = #name >> > + ifTrue: [configuration name: value]. >> >> This looks like a good candidate for a #caseOf:. >> > > Woohoo! It's the official start of our annual "caseOf is not object-oriented" > flame war! Let the festivities begin :-) It was just a spark! Of course, I've been tainted by pattern matching, so #caseOf: seems perfectly sensible to me... in situations like this. You're switching off some chunk of data rather than a class. I guess the Enterprise Ready OO Army would say that these concepts like #names and #dependency should be made Proper Objects. And maybe they're right. But sometimes the effort involved is just not worth it. See? _That's_ how you start the flames :) Blow, blow! frank > Dave |
In reply to this post by Chris Muller-3
On 08.10.2013, at 18:22, Chris Muller <[hidden email]> wrote:
> Will move this to trunk soon. Could you move the name to be stored at the top, before the repositories and dependencies? - Bert - > On Tue, Oct 8, 2013 at 11:17 AM, <[hidden email]> wrote: >> A new version of MonticelloConfigurations was added to project The Inbox: >> http://source.squeak.org/inbox/MonticelloConfigurations-cmm.116.mcz >> >> ==================== Summary ==================== >> >> Name: MonticelloConfigurations-cmm.116 >> Author: cmm >> Time: 8 October 2013, 11:17:41.275 am >> UUID: 7fc9bf79-f791-4d78-adb8-beddd88b90bd >> Ancestors: MonticelloConfigurations-bf.115 >> >> Persist MCConfiguration's 'name'. >> >> =============== Diff against MonticelloConfigurations-bf.115 =============== >> >> Item was changed: >> ----- Method: MCConfiguration class>>fromArray: (in category 'instance creation') ----- >> fromArray: anArray >> | configuration | >> configuration := self new. >> anArray pairsDo: [:key :value | >> key = #repository >> ifTrue: [configuration repositories add: (self repositoryFromArray: value)]. >> key = #dependency >> ifTrue: [configuration dependencies add: (self dependencyFromArray: value)]. >> + key = #name >> + ifTrue: [configuration name: value]. >> ]. >> ^configuration! >> >> Item was removed: >> - ----- Method: MCMcmReader>>configurationName (in category 'accessing') ----- >> - configurationName >> - ^fileName ifNotNil: [(fileName findTokens: '/\:') last copyUpToLast: $.]! >> >> Item was changed: >> ----- Method: MCMcmReader>>loadConfiguration (in category 'accessing') ----- >> loadConfiguration >> stream reset. >> configuration := MCConfiguration fromArray: (MCScanner scan: stream). >> + configuration name ifNil: [ configuration name: self parseNameFromFilename ]! >> - configuration name: self configurationName. >> - ! >> >> Item was added: >> + ----- Method: MCMcmReader>>parseNameFromFilename (in category 'accessing') ----- >> + parseNameFromFilename >> + ^fileName ifNotNil: [(fileName findTokens: '/\:') last copyUpToLast: $.]! >> >> Item was changed: >> ----- Method: MCMcmWriter>>writeConfiguration: (in category 'writing') ----- >> writeConfiguration: aConfiguration >> >> stream nextPut: $(. >> >> aConfiguration repositories do: [:ea | >> stream cr. >> stream nextPutAll: 'repository '. >> (MCConfiguration repositoryToArray: ea) printElementsOn: stream]. >> >> aConfiguration dependencies do: [:ea | >> stream cr. >> stream nextPutAll: 'dependency '. >> (MCConfiguration dependencyToArray: ea) printElementsOn: stream]. >> >> + stream nextPutAll: 'name '; nextPutAll: aConfiguration name printString. >> + >> stream cr. >> stream nextPut: $). >> stream cr.! >> >> > |
Free forum by Nabble | Edit this page |