On Friday, 15 June 2012 at 07:15:50 UTC, Jonathan M Davis wrote:
On Friday, June 15, 2012 09:09:48 Don Clugston wrote:
On 10/06/12 23:43, Jonathan M Davis wrote:
> On Sunday, June 10, 2012 23:23:57 Mehrdad wrote:
>> I honestly don't see the POINT of having a "dynamic array
>> literal".
>>
>> Wh
On Friday, June 15, 2012 09:09:48 Don Clugston wrote:
> On 10/06/12 23:43, Jonathan M Davis wrote:
> > On Sunday, June 10, 2012 23:23:57 Mehrdad wrote:
> >> I honestly don't see the POINT of having a "dynamic array
> >> literal".
> >>
> >> What's the point of making the literals dynamic?
> >>
> >
On 10/06/12 23:43, Jonathan M Davis wrote:
On Sunday, June 10, 2012 23:23:57 Mehrdad wrote:
I honestly don't see the POINT of having a "dynamic array
literal".
What's the point of making the literals dynamic?
They should all be static, and only converted to dynamic if
necessary from the contex
"Steven Schveighoffer" , dans le message (digitalmars.D:169718), a
écrit :
> Note that D1 was like this, [1,2,3] was auto-typed to int[3u]. It was a
> constant source of pain that I would not like to revisit. Especially
> since static arrays are now passed by value.
>
> -Steve
Since static
Artur Skawina , dans le message (digitalmars.D:169717), a écrit :
> On 06/11/12 12:06, Christophe Travert wrote:
>> Jonathan M Davis , dans le message (digitalmars.D:169705), a écrit :
>>> auto found = find([1, 2, 3, 4, 5], 3);
>>
>> No problem if the rule could be the following:
>> - array liter
On Sun, 10 Jun 2012 20:08:53 -0400, Mehrdad wrote:
Type deduction.
Exactly. And if they need to be assigned to a static array, then the
compiler
can automatically do what it needs to do to avoid the extra heap
allocation.
- Jonathan M Davis
"Type deduction"? o.O
I don't understand..
On 06/11/12 12:06, Christophe Travert wrote:
> Jonathan M Davis , dans le message (digitalmars.D:169705), a écrit :
>> auto found = find([1, 2, 3, 4, 5], 3);
>
> No problem if the rule could be the following:
> - array literals are static by default
> - array literals are copied to the heap when
Jonathan M Davis , dans le message (digitalmars.D:169705), a écrit :
> auto found = find([1, 2, 3, 4, 5], 3);
No problem if the rule could be the following:
- array literals are static by default
- array literals are copied to the heap when assigned to a dynamic
array.
- the former rule applie
On Monday, June 11, 2012 05:09:49 Mehrdad wrote:
> On Monday, 11 June 2012 at 03:05:36 UTC, Jonathan M Davis wrote:
> > What are you trying to fix beyond assignments to static arrays
> > with array literals?
>
> Just the fact that it would reduce unnecessary heap allocations.
> I'm not trying to '
On Monday, 11 June 2012 at 03:05:36 UTC, Jonathan M Davis wrote:
What are you trying to fix beyond assignments to static arrays
with array literals?
Just the fact that it would reduce unnecessary heap allocations.
I'm not trying to 'fix' it though, as it's not broken. (Then
again, neither is i
On Monday, June 11, 2012 04:47:36 Mehrdad wrote:
> On Monday, 11 June 2012 at 02:25:54 UTC, Jonathan M Davis wrote:
> > Now, since in this particular case, what find returns won't
> > ever include anything from any arguments other than the first,
> > it'll be fine.
>
> Yes, that's precisely why yo
On Monday, 11 June 2012 at 02:25:54 UTC, Jonathan M Davis wrote:
Now, since in this particular case, what find returns won't
ever include anything from any arguments other than the first,
it'll be fine.
Yes, that's precisely why your statement didn't make sense to me.
:)
But for any temp
On Monday, June 11, 2012 04:13:42 Mehrdad wrote:
> On Monday, 11 June 2012 at 00:57:45 UTC, Jonathan M Davis wrote:
> > And if all range-based functions were altered to work with
> > static arrays, and we made array literals static, then this
> > example would _still_ be broken
> > auto found = fin
On Monday, 11 June 2012 at 00:57:45 UTC, Jonathan M Davis wrote:
And if all range-based functions were altered to work with
static arrays, and we made array literals static, then this
example would _still_ be broken
auto found = find(arr, [1, 2]);
Sorry, I don't quite seem to follow. :\
Woul
On Monday, June 11, 2012 02:45:00 Mehrdad wrote:
> On Monday, 11 June 2012 at 00:16:48 UTC, Jonathan M Davis wrote:
> > auto found = find(arr, [1, 2]);
> >
> > wouldn't compile, because [1, 2] would be considered a static
> > array, which
> > isn't a range.
> >
> > - Jonathan M Davis
>
> Uh... t
On Monday, 11 June 2012 at 00:16:48 UTC, Jonathan M Davis wrote:
auto found = find(arr, [1, 2]);
wouldn't compile, because [1, 2] would be considered a static
array, which
isn't a range.
- Jonathan M Davis
Uh... that's pretty much just saying, "code that explicitly
depends on the current
On Monday, June 11, 2012 02:08:53 Mehrdad wrote:
> >> Type deduction.
> >
> > Exactly. And if they need to be assigned to a static array,
> > then the compiler
> > can automatically do what it needs to do to avoid the extra
> > heap allocation.
> >
> > - Jonathan M Davis
>
> "Type deduction"? o
Type deduction.
Exactly. And if they need to be assigned to a static array,
then the compiler
can automatically do what it needs to do to avoid the extra
heap allocation.
- Jonathan M Davis
"Type deduction"? o.O
I don't understand... could someone give me an example of what
would break
On Monday, June 11, 2012 01:35:41 Timon Gehr wrote:
> On 06/11/2012 12:28 AM, Mehrdad wrote:
> > Ugh... you keep on saying "on occasion" and "particular case", making it
> > seem like it's such a rarity that it's not worth mentioning.
> >
> >
> >
> > Regarding your examples: the rule is quite si
On 06/11/2012 12:28 AM, Mehrdad wrote:
Ugh... you keep on saying "on occasion" and "particular case", making it
seem like it's such a rarity that it's not worth mentioning.
Regarding your examples: the rule is quite simple:
- Literals are static by default
- If they are to be assigned to a dy
Ugh... you keep on saying "on occasion" and "particular case",
making it seem like it's such a rarity that it's not worth
mentioning.
Regarding your examples: the rule is quite simple:
- Literals are static by default
- If they are to be assigned to a dynamic array, then make them
dynamic i
On Sunday, June 10, 2012 23:23:57 Mehrdad wrote:
> I honestly don't see the POINT of having a "dynamic array
> literal".
>
> What's the point of making the literals dynamic?
>
> They should all be static, and only converted to dynamic if
> necessary from the context.
>
> But I really don't see t
I honestly don't see the POINT of having a "dynamic array
literal".
What's the point of making the literals dynamic?
They should all be static, and only converted to dynamic if
necessary from the context.
But I really don't see the benefit of allocating them on the heap
just because we can.
On 06/10/12 19:32, Timon Gehr wrote:
> On 06/10/2012 07:00 PM, Artur Skawina wrote:
>> On 06/10/12 18:02, Timon Gehr wrote:
>>> On 06/10/2012 04:54 PM, Artur Skawina wrote:
...
An array literal is a dynamic array with a known constant length that
implicitly converts to a static array
On 06/10/2012 07:00 PM, Artur Skawina wrote:
On 06/10/12 18:02, Timon Gehr wrote:
On 06/10/2012 04:54 PM, Artur Skawina wrote:
...
An array literal is a dynamic array with a known constant length that
implicitly converts to a static array of the same size and element type.
That's a sane definit
On 06/10/12 18:02, Timon Gehr wrote:
> On 06/10/2012 04:54 PM, Artur Skawina wrote:
>> On 06/10/12 10:47, mta`chrono wrote:
>>> Am 10.06.2012 01:02, schrieb Timon Gehr:
On 06/10/2012 12:34 AM, Jonathan M Davis wrote:
> On Sunday, June 10, 2012 00:15:01 Timon Gehr wrote:
>> D static arr
On 06/10/2012 04:54 PM, Artur Skawina wrote:
On 06/10/12 10:47, mta`chrono wrote:
Am 10.06.2012 01:02, schrieb Timon Gehr:
On 06/10/2012 12:34 AM, Jonathan M Davis wrote:
On Sunday, June 10, 2012 00:15:01 Timon Gehr wrote:
D static array literals don't perform a costly heap allocation. It is
writefln(typeof([1, 2, 3, 4, 5]).stringof) is int[5u] in D1 haha.
On 06/10/12 10:47, mta`chrono wrote:
> Am 10.06.2012 01:02, schrieb Timon Gehr:
>> On 06/10/2012 12:34 AM, Jonathan M Davis wrote:
>>> On Sunday, June 10, 2012 00:15:01 Timon Gehr wrote:
D static array literals don't perform a costly heap allocation. It is
simply a bug in the implementati
Am 10.06.2012 01:02, schrieb Timon Gehr:
> On 06/10/2012 12:34 AM, Jonathan M Davis wrote:
>> On Sunday, June 10, 2012 00:15:01 Timon Gehr wrote:
>>> D static array literals don't perform a costly heap allocation. It is
>>> simply a bug in the implementation. This is not a compelling reason to
>>>
On Sunday, June 10, 2012 01:02:40 Timon Gehr wrote:
> On 06/10/2012 12:34 AM, Jonathan M Davis wrote:
> > On Sunday, June 10, 2012 00:15:01 Timon Gehr wrote:
> >> D static array literals don't perform a costly heap allocation. It is
> >> simply a bug in the implementation. This is not a compelling
On 10-06-2012 01:02, Timon Gehr wrote:
On 06/10/2012 12:34 AM, Jonathan M Davis wrote:
On Sunday, June 10, 2012 00:15:01 Timon Gehr wrote:
D static array literals don't perform a costly heap allocation. It is
simply a bug in the implementation. This is not a compelling reason to
add new syntax.
On 06/10/2012 12:34 AM, Jonathan M Davis wrote:
On Sunday, June 10, 2012 00:15:01 Timon Gehr wrote:
D static array literals don't perform a costly heap allocation. It is
simply a bug in the implementation. This is not a compelling reason to
add new syntax.
D
DMD
doesn't _have_ static array
On Sunday, June 10, 2012 00:15:01 Timon Gehr wrote:
> D static array literals don't perform a costly heap allocation. It is
> simply a bug in the implementation. This is not a compelling reason to
> add new syntax.
D doesn't _have_ static array literals. It only has dynamic array literals.
int[5]
On 06/10/2012 12:05 AM, timotheecour wrote:
(apologies for cross-posting here, I feel this is a better place to ask
than in my original post where I only received 1 answer that seemed in
favor of this:
http://d.puremagic.com/issues/show_bug.cgi?id=8008 which was 2 months ago).
Please see to the
(apologies for cross-posting here, I feel this is a better place
to ask than in my original post where I only received 1 answer
that seemed in favor of this:
http://d.puremagic.com/issues/show_bug.cgi?id=8008 which was 2
months ago).
Please see to the original post above to see the proposal fo
36 matches
Mail list logo