A new version of Sound was added to project The Inbox:
http://source.squeak.org/inbox/Sound-ct.69.mcz ==================== Summary ==================== Name: Sound-ct.69 Author: ct Time: 1 October 2019, 8:25:38.912339 pm UUID: b0d38e4d-1231-494f-8502-e1a631e232b3 Ancestors: Sound-eem.66 Add convenience setter for MIDIScore These values are strongly related and should in most cases be set at once. =============== Diff against Sound-eem.66 =============== Item was changed: ----- Method: MIDIFileReader>>asScore (in category 'chunk reading') ----- asScore ^ MIDIScore new + tracks: tracks trackInfo: trackInfo; - tracks: tracks; - trackInfo: trackInfo; tempoMap: tempoMap; ticksPerQuarterNote: ticksPerQuarter; source: stream localName ! Item was added: + ----- Method: MIDIScore>>tracks:trackInfo: (in category 'accessing') ----- + tracks: trackList trackInfo: trackInfoList + + self tracks: trackList; trackInfo: trackInfoList.! |
Hi
I don't understand the rationale here. Care to explain? What's so different with the "dual" setter? Best regards -Tobias > On 01.10.2019, at 20:25, [hidden email] wrote: > > A new version of Sound was added to project The Inbox: > http://source.squeak.org/inbox/Sound-ct.69.mcz > > ==================== Summary ==================== > > Name: Sound-ct.69 > Author: ct > Time: 1 October 2019, 8:25:38.912339 pm > UUID: b0d38e4d-1231-494f-8502-e1a631e232b3 > Ancestors: Sound-eem.66 > > Add convenience setter for MIDIScore > > These values are strongly related and should in most cases be set at once. > > =============== Diff against Sound-eem.66 =============== > > Item was changed: > ----- Method: MIDIFileReader>>asScore (in category 'chunk reading') ----- > asScore > > ^ MIDIScore new > + tracks: tracks trackInfo: trackInfo; > - tracks: tracks; > - trackInfo: trackInfo; > tempoMap: tempoMap; > ticksPerQuarterNote: ticksPerQuarter; > source: stream localName > ! > > Item was added: > + ----- Method: MIDIScore>>tracks:trackInfo: (in category 'accessing') ----- > + tracks: trackList trackInfo: trackInfoList > + > + self tracks: trackList; trackInfo: trackInfoList.! > > |
Hi,
No special reason. Each trackInfo item describes one tracks item, so I thought it could be a good idea to set them at once. Equal to #setString:setRuns: or #real:imaginary:, for example. If you don't think it improves code quality, I can abstain from it. :)
Best, Christoph Von: Squeak-dev <[hidden email]> im Auftrag von Tobias Pape <[hidden email]>
Gesendet: Dienstag, 1. Oktober 2019 20:58:49 An: [hidden email] Betreff: Re: [squeak-dev] The Inbox: Sound-ct.69.mcz Hi
I don't understand the rationale here. Care to explain? What's so different with the "dual" setter? Best regards -Tobias > On 01.10.2019, at 20:25, [hidden email] wrote: > > A new version of Sound was added to project The Inbox: > http://source.squeak.org/inbox/Sound-ct.69.mcz > > ==================== Summary ==================== > > Name: Sound-ct.69 > Author: ct > Time: 1 October 2019, 8:25:38.912339 pm > UUID: b0d38e4d-1231-494f-8502-e1a631e232b3 > Ancestors: Sound-eem.66 > > Add convenience setter for MIDIScore > > These values are strongly related and should in most cases be set at once. > > =============== Diff against Sound-eem.66 =============== > > Item was changed: > ----- Method: MIDIFileReader>>asScore (in category 'chunk reading') ----- > asScore > > ^ MIDIScore new > + tracks: tracks trackInfo: trackInfo; > - tracks: tracks; > - trackInfo: trackInfo; > tempoMap: tempoMap; > ticksPerQuarterNote: ticksPerQuarter; > source: stream localName > ! > > Item was added: > + ----- Method: MIDIScore>>tracks:trackInfo: (in category 'accessing') ----- > + tracks: trackList trackInfo: trackInfoList > + > + self tracks: trackList; trackInfo: trackInfoList.! > >
Carpe Squeak!
|
> On 01.10.2019, at 21:49, Thiede, Christoph <[hidden email]> wrote: > > Hi, > > No special reason. Each trackInfo item describes one tracks item, so I thought it could be a good idea to set them at once. Equal to #setString:setRuns: or #real:imaginary:, for example. I see your point. However, these two are more private (as most #set… are). The one for Complex could be even thought of as primitive and maybe this method shouldn't be necessary conceptually. > If you don't think it improves code quality, I can abstain from it. :) No problem, I was just wondering. In cases where you want to communicate the _caller_ that something should be thought of as a unit, I would probably make a class-side convenience constructor. Keep it coming :D Best regards -Tobias > > Best, > Christoph > Von: Squeak-dev <[hidden email]> im Auftrag von Tobias Pape <[hidden email]> > Gesendet: Dienstag, 1. Oktober 2019 20:58:49 > An: [hidden email] > Betreff: Re: [squeak-dev] The Inbox: Sound-ct.69.mcz > > Hi > > I don't understand the rationale here. > Care to explain? > What's so different with the "dual" setter? > Best regards > -Tobias > > On 01.10.2019, at 20:25, [hidden email] wrote: > > > > A new version of Sound was added to project The Inbox: > > http://source.squeak.org/inbox/Sound-ct.69.mcz > > > > ==================== Summary ==================== > > > > Name: Sound-ct.69 > > Author: ct > > Time: 1 October 2019, 8:25:38.912339 pm > > UUID: b0d38e4d-1231-494f-8502-e1a631e232b3 > > Ancestors: Sound-eem.66 > > > > Add convenience setter for MIDIScore > > > > These values are strongly related and should in most cases be set at once. > > > > =============== Diff against Sound-eem.66 =============== > > > > Item was changed: > > ----- Method: MIDIFileReader>>asScore (in category 'chunk reading') ----- > > asScore > > > > ^ MIDIScore new > > + tracks: tracks trackInfo: trackInfo; > > - tracks: tracks; > > - trackInfo: trackInfo; > > tempoMap: tempoMap; > > ticksPerQuarterNote: ticksPerQuarter; > > source: stream localName > > ! > > > > Item was added: > > + ----- Method: MIDIScore>>tracks:trackInfo: (in category 'accessing') ----- > > + tracks: trackList trackInfo: trackInfoList > > + > > + self tracks: trackList; trackInfo: trackInfoList.! > > > > |
This only makes sense if both are required to construct a meaningful object. Just for convenience, it wouldn't add anything. #setString:setRuns: for Text is such a meaningful combination. -1 :-) Best, Marcel
|
Okay, then discard the proposal :) Or can I move it to the Treated Inbox myself?
Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Mittwoch, 2. Oktober 2019 08:47:38 An: Alan Grimes via Squeak-dev Betreff: Re: [squeak-dev] The Inbox: Sound-ct.69.mcz
This only makes sense if both are required to construct a meaningful object. Just for convenience, it wouldn't add anything. #setString:setRuns: for Text is such a meaningful combination.
-1 :-)
Best,
Marcel
Carpe Squeak!
|
Free forum by Nabble | Edit this page |