May 19, 2015
On Tue, 19 May 2015 11:36:32 +0000, Chris wrote:

> On Tuesday, 19 May 2015 at 11:08:52 UTC, thedeemon wrote:
>> On Monday, 18 May 2015 at 14:30:43 UTC, Chris wrote:
>>
>>> Why is _accessing_ an assoc treated as indexing it?
>>
>> Are you sure you understand "indexing" as we do? It's not like indexing of databases, it's just "accessing by index" i.e. using myarray[some_index].
> 
> I understood indexing as assigning an index to something
> 
> myarray["Index1"] = "First Entry";
> 
> As in
> 
> https://en.wiktionary.org/wiki/indexing https://en.wiktionary.org/wiki/index#Verb

and that's wrong. ;-) most programmers in this case read "indexing" as "accesing by index". it's a common term for such access.

tbh, i didn't even understand you fully until i read the post i'm answering to.

May 19, 2015
On Tuesday, 19 May 2015 at 12:41:29 UTC, ketmar wrote:
> On Tue, 19 May 2015 11:36:32 +0000, Chris wrote:
>
>> On Tuesday, 19 May 2015 at 11:08:52 UTC, thedeemon wrote:
>>> On Monday, 18 May 2015 at 14:30:43 UTC, Chris wrote:
>>>
>>>> Why is _accessing_ an assoc treated as indexing it?
>>>
>>> Are you sure you understand "indexing" as we do? It's not like indexing
>>> of databases, it's just "accessing by index" i.e. using
>>> myarray[some_index].
>> 
>> I understood indexing as assigning an index to something
>> 
>> myarray["Index1"] = "First Entry";
>> 
>> As in
>> 
>> https://en.wiktionary.org/wiki/indexing
>> https://en.wiktionary.org/wiki/index#Verb
>
> and that's wrong. ;-) most programmers in this case read "indexing" as
> "accesing by index". it's a common term for such access.

Is that so. I don't remember having come across this meaning. It is usually called "access" or "indexing access" (cf. http://dlang.org/hash-map.html). I still think that saying just "indexing" is not correct in -vgc, since it can be both assignment and access.

> tbh, i didn't even understand you fully until i read the post i'm
> answering to.

May 19, 2015
On Monday, 18 May 2015 at 14:34:38 UTC, ketmar wrote:
> it can throw "out of range" error, which is `new`ed.

Array access can also throw RangeError, but -vgc and @nogc don't mind that:
----
void main() @nogc
{
    int[] a;
    auto b = a[0];
}
----
May 19, 2015
On Tue, 19 May 2015 13:17:15 +0000, anonymous wrote:

> On Monday, 18 May 2015 at 14:34:38 UTC, ketmar wrote:
>> it can throw "out of range" error, which is `new`ed.
> 
> Array access can also throw RangeError, but -vgc and @nogc don't mind that:
> ----
> void main() @nogc {
>      int[] a;
>      auto b = a[0];
> }
> ----

hm. now either this is bug, or "-vgc" should not warn about AA access. will you fill an issue in bugzilla?

1 2
Next ›   Last »