On 25 Mar 2007, at 16:35, realbasic-nug- 
[EMAIL PROTECTED] wrote:

> To: REALbasic NUG <[email protected]>
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
>
>
> On Mar 25, 2007, at 10:32 AM, John Kubie wrote:
>
>>
>> On Mar 25, 2007, at 9:49 AM, Charles Yeomans wrote:
>>
>>> What is it that you find confusing about the Dictionary interface?
>>
>> The first awkwardness is the apparent necessity to test for the
>> existence of a key before getting the key-value combination
>> Next, the word "key" is not used when getting a value associated with
>> a key.

ElfDataDictionary doesn't impose this. You can just get value and if  
it doesn't exist, nil is returned.

Also, I think Norman gave a good solution for making Dictionaries  
easier to use (Which can be used for ElfDataDictionary even)...

But one idea for a language addition, would be to allow for function  
call type syntax.

dim d as new dictionary

d("fred") = 5
d("harry") = 10
d("herman") = 7.5


something like that.

In C++ you can do this already, although it uses angle brackets like  
this:



d["fred"] = 5
d["harry"] = 10
d["herman"] = 7.5


I actually think the angle brackets look better, because it's obvious  
that it's an array and not a function. But RB uses () brackets for  
arrays anyhow, so we may as well continue to use them... Unless RB  
wants to change array access syntax also.



_______________________________________________
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