On 01/02/2018 11:17 AM, Jonathan M Davis wrote:
> On Tuesday, January 02, 2018 10:37:17 Ali Çehreli via Digitalmars-d-learn
> wrote:
>> For these reasons, the interface that the program is using is a "slice".
>> Dynamic array is a different concept owned and implemented by the GC.
>
> Except that
On Tuesday, January 02, 2018 10:37:17 Ali Çehreli via Digitalmars-d-learn
wrote:
> As soon as we call it "dynamic array", I can't help but think "adding
> elements". Since GC is in the picture when that happens, it's essential
> to think GC when adding an element is involved.
>
> Further, evident
gt;> same thing as a C++ std::vector, or a Java/.Net ArrayList, etc.
My view as well.
>> And D
>> "array slices" (the proper term IMO) are not the same.
Exactly!
>> I'm willing to change the article to mention "Array slices" instead of
>> just &q
Net ArrayList, etc. And D
> "array slices" (the proper term IMO) are not the same.
>
> I'm willing to change the article to mention "Array slices" instead of
> just "slices", because that is a valid criticism. But I don't want to
> change it from sl
a valid criticism. But I don't want to
change it from slices to dynamic arrays, since the whole article is
written around the subtle difference. I think the difference is important.
-Steve
[1] https://en.wikipedia.org/wiki/Dynamic_array
On Monday, 1 January 2018 at 02:10:14 UTC, Jonathan M Davis wrote:
On Sunday, December 31, 2017 14:49:40 Tony via
Digitalmars-d-learn wrote:
On Sunday, 31 December 2017 at 14:24:40 UTC, Jonathan M Davis
wrote:
> [...]
The DLang Tour also uses the term slice to refer to T[].
"The type of arr
On Monday, January 01, 2018 05:06:46 Tony via Digitalmars-d-learn wrote:
> On Monday, 1 January 2018 at 02:10:14 UTC, Jonathan M Davis wrote:
> > The DLang Tour should probably be fixed to use the term dynamic
> > array though.
>
> Or embrace both terms but take care that it is clear that they
>
On Monday, 1 January 2018 at 02:10:14 UTC, Jonathan M Davis wrote:
The DLang Tour should probably be fixed to use the term dynamic
array though.
Or embrace both terms but take care that it is clear that they
are synonyms and one may be preferred depending on context. As a
beginner, I had
uffer
> > the dynamic array instead of calling T[] the dynamic array like
> > the language and spec do. Regardless, all non-null dynamic
> > arrays are slices of memory.
>
> The DLang Tour also uses the term slice to refer to T[].
>
> "The type of arr is int[], whi
. Regardless, all non-null dynamic
arrays are slices of memory.
The DLang Tour also uses the term slice to refer to T[].
"The type of arr is int[], which is also called a slice."
"A slice consists of two members - a pointer to the starting
element and the length of the slice:"
quot; as
> synonyms. My initial impression was that they must have different
> code underlying them, and different behavior. I would pick one or
> the other. It should be:
>
> D Arrays
>- Static
>- Dynamic
>
> or
>
> D Arrays
> - Static
> - Slice
On Sunday, December 31, 2017 04:42:01 Tony via Digitalmars-d-learn wrote:
> On Sunday, 31 December 2017 at 04:20:28 UTC, codephantom wrote:
> > On Sunday, 31 December 2017 at 03:57:17 UTC, Tony wrote:
> >> On Sunday, 31 December 2017 at 03:08:05 UTC, Ivan Trombley
> >>
> >> wrote:
> >>> double[] D
On 12/30/17 10:08 PM, Ivan Trombley wrote:
double[] D = [3.14159];
Can you guess what D is? :D
An approximation of a slice of pi.
-Steve
y it
references. Normally you would consider a dynamic array to own its
memory (i.e. be responsible for allocation and destruction). Because we
have the GC, ownership can be fuzzy.
The DLang Tour has a section on Slices that says in bold "Slices and
dynamic arrays are the sa
On Sunday, 31 December 2017 at 04:20:28 UTC, codephantom wrote:
On Sunday, 31 December 2017 at 03:57:17 UTC, Tony wrote:
On Sunday, 31 December 2017 at 03:08:05 UTC, Ivan Trombley
wrote:
double[] D = [3.14159];
Can you guess what D is? :D
It took me a while but I finally came up with "a
On Sunday, 31 December 2017 at 03:57:17 UTC, Tony wrote:
On Sunday, 31 December 2017 at 03:08:05 UTC, Ivan Trombley
wrote:
double[] D = [3.14159];
Can you guess what D is? :D
It took me a while but I finally came up with "a slice of pi"
a slice of pi is irrational.
On Sunday, 31 December 2017 at 03:08:05 UTC, Ivan Trombley wrote:
double[] D = [3.14159];
Can you guess what D is? :D
It took me a while but I finally came up with "a slice of pi"
double[] D = [3.14159];
Can you guess what D is? :D
- Static
- Dynamic
or
D Arrays
- Static
- Slice
The DLang Tour has a section on Slices that says in bold "Slices
and dynamic arrays are the same". I think that sentence deserves
an explanation as to why there are two terms being utilized for
the same thing. I would pref
On Friday, December 29, 2017 22:32:01 Tony via Digitalmars-d-learn wrote:
> In DLang Tour:Arrays
> https://tour.dlang.org/tour/en/basics/arrays
>
> there is:
> ---
> int size = 8; // run-time variable
> int[] arr = new int[size];
>
> The type of arr is
On Friday, 29 December 2017 at 22:32:01 UTC, Tony wrote:
In DLang Tour:Arrays
https://tour.dlang.org/tour/en/basics/arrays
there is:
---
int size = 8; // run-time variable
int[] arr = new int[size];
The type of arr is int[], which is a slice.
On Friday, 29 December 2017 at 22:32:01 UTC, Tony wrote:
Based on those two web pages it appears that the name for a
dynamic array in D is "slice". That is, anytime
you have a dynamic array (even a null reference version) it is
called a slice. Is that correct?
Not exactly, but
In DLang Tour:Arrays
https://tour.dlang.org/tour/en/basics/arrays
there is:
---
int size = 8; // run-time variable
int[] arr = new int[size];
The type of arr is int[], which is a slice.
---
In "D Slices"
23 matches
Mail list logo