[squeak-dev] Squeaking up for "'click' sound play"

Bert Freudenberg bert at freudenbergs.de
Wed Apr 14 14:24:39 UTC 2010


On 14.04.2010, at 03:25, Jerome Peace wrote:
> 
> Hi laza, hi all,
> 
> 
> I was hoping to get this adopted quietly. The gatekeepers are asking me to show support for this feature. If you are in favor of this let it be heard.
> 
> In:
> 7497: [FIX][Enh] Sound that name.
> http://bugs.squeak.org/view.php?id=7497
> 
> laza has written:
>> 
>> Also I guess you will need to mobilize more supporters for your idea on squeak-dev to make this happen. 
>> 
>> Just to say, that I wouldn't like the String class to be "polluted" with such "convenience" methods. There would be no end ...
>> 
>> String image
>> String morph
>> String fileContent
>> ... 
>> 
> To which I have replied:
> 
> 
> My take is that in squeak everything is an object. This means that basic classes such as number and string serve as objects. It leads to the following problem:
> 
> The number or name of something acts as a modifier, yet if you use the number or name first in squeak it is a receiver. To have a worthwhile language which resembles my speaking language I choose to allow my modifiers to be receivers.
> 
> It is stupid IMO to invent classes inorder to use modifiers as argument parameters. In squeak modifiers sometimes belong in the position of receivers.
> 
> In this case the problem is the invented and arbitrary class that takes the sound name as an argument was deprecated and nuked. Leaving broken code behind it.
> 
> The easy and English sounding way to avoid this is to give the modifier it's rightful place as the receiver of the message.
> 
> 'click' sound play.
> 
> Is IMHO the right way to say lets play a click like sound. It sounds right when you speak it.
> 
> I feel very strongly about this.
> 
> Any other solution I could propose would involve arbitrary invention and would not be as general.
> 
> Who wants to remember what class is responsible for playing a click sound when programming an application? This solution is elegant.
> 
> Remember the old class used was Object.
> 
> So you could say:
> 
> self beep: 'click'
> and aviod looking up the sound making class or creating a new object just to play your sound.
> 
> Conversion methods are used all the time. While I have seen some warning against using them too readily I have not seen any more elegant solutions.
> 
> So I am stating that all strings should be able to make a sound if they so wish.
> 
> The #sound method is in charge of knowing what that sound should be. Playing a library sound if one exists or a default sound if one does not. It doesn't belong to the String package it belongs to the Sound package along with the class that keeps the Sound Library. It extends the String classes.
> 
> The programmer should be having fun using squeak not a frustrating time trying to find the missing word.
> 
> Sorry for the rant. I feel quite strongly about this and dislike the additional hurdles being put in the way of an elegant solution.
> 
> Rantingly, --Jerome Peace

I follow your reasoning. However, conversion methods usually follow the asXYZ pattern.

With #asSound I would have less problems. #asSampledSound would be even more correct, since I guess you would map it to "^SampledSound soundNamed: self", right?

#sound to me is not intention-revealing enough for inclusion in the base system.

- Bert -





More information about the Squeak-dev mailing list