On Mar 25, 2007, at 11:28 AM, Charles Yeomans wrote:

>>
>> If I were to try say what the second line is doing it is something
>> like:
>> "get the value associated with the key "name" from myDictionary and
>> assign it to "myvariable".
>>
>> If the second line were:
>>     myvariable=mydictionary.KEY("name")
>> it would make more sense to me.
>
> But it would be wrong.  mydictionary.value returns the value
> associated to the key passed as the parameter.  You described it
> correctly above.

I was making up the syntax, without a lot of thought. But the point  
is that the 'correct' line doesn't have the word "key" in it, so this  
must be implicit knowledge. It's more difficult. And making a  
grammatical sentence of it is not easy.

An applescript-type syntax might be

      "get the value associated with the key name from mydictionary"

While wordy, this is a sentence I can read.

Another problem with dictionaries: the word 'dictionary'. While an  
adequate description of how things are stored and accessed, the name  
hides the power.
A novice is frequently scared of doing things wrong and getting into  
traps. This novice would be hesitant to use a dictionary as a not- 
obvious general method for returning
multiple values from a method. If a dictionary were called something  
like a "pairedValueHolder" its general utility might be more obvious  
(not a serious suggestion).

Also, Normal Palardy's suggestions are intriguing and something to  
think about.

john kubie
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to