[Newbies] Re: [squeak-dev] Squeaking up for "'click' sound play"
peace_the_dreamer at yahoo.com
Thu Apr 15 23:48:48 UTC 2010
--- On Wed, 4/14/10, K. K. Subramaniam <subbukk at gmail.com> wrote:
> From: K. K. Subramaniam <subbukk at gmail.com>
> Subject: Re: [squeak-dev] Squeaking up for "'click' sound play"
> To: squeak-dev at lists.squeakfoundation.org
> Cc: "Jerome Peace" <peace_the_dreamer at yahoo.com>
> Date: Wednesday, April 14, 2010, 11:00 AM
> On Wednesday 14 April 2010 06:55:04
> am Jerome Peace wrote:
> > 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.
> Please consider all implications of your proposal.
> Tokens like 'click', #click or 23 are not modifiers. They
> are just abstract
> indices. They don't mean anything by themselves. A context
> is needed to impart
> meaning to them.
> You are suggesting that we embed this context into the
> String class. But the
> same logic may lead others to patching Symbol and Number
> classes too.
> The scheme will blow up in multilingual situations. How do
> you handle language
> variants - 'hello', 'allo', 'hola' and so on.
How would you?
I would add the words to the sound library. Either connected to their particular sounds or redefining the sound I want them to refer to.
Even if I did nothing
"'allo' sound play."
would make the default sound.
> Take another example, say 'bark'. I may want to generate a
> 'bow wow' sound in
> a particular context and 'woof woof' in another context.
Suppose you did. How would you want to do it?
bark := 'bow wow' .
bark sound play.
bark := 'woof woof'
bark sound play.
bark := 'bow wow' sound .
bark := 'woof woof' sound .
bark play .
Though in the latter case I might use barkSound instead of bark as the variable.
> would rather have
> this logic put into Sound class rather spread it amongst
> basic classes.
Hmmm. In packaging the selector has been put in an extention so that it is packaged with Sound Library.
In protocol it belongs as an instance method for String class and subclasses.
> Would you extend the same reasoning to
> 1005 asPlatformName
> ^Smalltalk current getSystemAttribute: self.
You mean instead of "SmalltalkImage current platformName" ?
No, because 1005 asPlatformName has no meaning for me. It certainly would make code reading more mysterious.
When I went to read it again I would not remember why 1005 was to be associated with anything let alone PlatformName. It also seems a very straw man like example. In that case its not the programmer who should be remembering the specific index.
The principles involved here is to form the language to
1) Write intention revealing code.
2) Create as little dissonance with the language the programmer already has in his head.*
Smalltalk gives you the chance to have programming language that sounds like natural talk. That's important to use.
Yours in curiosity and service, --Jerome Peace
*Currently this is biased towards English/American.
More information about the Beginners