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
First, I'm in complete agreement with Steve on this. I wrote a response
to you yesterday, which I decided to not send after counting to ten
because despite being much more difficult, I see that your view can also
be aggreable.
On 01/02/2018 10:02 AM, Jonathan M Davis wrote:
> On Tuesday, Jan
On Tuesday, January 02, 2018 07:53:00 Steven Schveighoffer via Digitalmars-
d-learn wrote:
> On 1/1/18 12:18 AM, Jonathan M Davis wrote:
> > A big problem with the term slice though is that it means more than just
> > dynamic arrays - e.g. you slice a container to get a range over it, so
> > that r
On 1/1/18 12:18 AM, Jonathan M Davis wrote:
A big problem with the term slice though is that it means more than just
dynamic arrays - e.g. you slice a container to get a range over it, so that
range is a slice of the container even though no arrays are involved at all.
So, you really can't rely
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 i
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
> ar
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 s
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 D Slices article does an excellent job of explaining all of
> > this. It's just that it calls the GC-allocated memory buffer
> > the dynamic a
On Sunday, 31 December 2017 at 14:24:40 UTC, Jonathan M Davis
wrote:
The D Slices article does an excellent job of explaining all of
this. It's just that it calls the GC-allocated memory buffer
the dynamic array instead of calling T[] the dynamic array like
the language and spec do. Regardl
mic array" 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
>
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
memory 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
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 sli
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
be:
D Arrays
- 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
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 in
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 basically. rea
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"
htt
23 matches
Mail list logo