Re: Make int[12] convertible to int[]

2015-01-11 Thread Jonathan M Davis via Digitalmars-d
On Friday, December 19, 2014 09:47:43 Shachar Shemesh via Digitalmars-d wrote: On 17/12/14 17:02, Adam D. Ruppe wrote: On Wednesday, 17 December 2014 at 13:13:43 UTC, Shachar Shemesh wrote: It just seems like extra unneeded superfluous unnecessary redundancy. It is somewhat important

Re: Make int[12] convertible to int[]

2014-12-18 Thread Shachar Shemesh via Digitalmars-d
On 17/12/14 17:02, Adam D. Ruppe wrote: On Wednesday, 17 December 2014 at 13:13:43 UTC, Shachar Shemesh wrote: It just seems like extra unneeded superfluous unnecessary redundancy. It is somewhat important because storing a slice to a static array is a big problem: Any time you pass by

Make int[12] convertible to int[]

2014-12-17 Thread Shachar Shemesh via Digitalmars-d
The subject pretty much says it all. If I have a function: void function(int[] arr); I'd like to be able to call it with: int[12] a; function(a); I know I can do: function(a[]); It just seems like extra unneeded superfluous unnecessary redundancy. I don't see any static typing

Re: Make int[12] convertible to int[]

2014-12-17 Thread bearophile via Digitalmars-d
Shachar Shemesh: The subject pretty much says it all. If I have a function: void function(int[] arr); I'd like to be able to call it with: int[12] a; function(a); I know I can do: function(a[]); It just seems like extra unneeded superfluous unnecessary redundancy. I don't see any static

Re: Make int[12] convertible to int[]

2014-12-17 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 17 December 2014 at 13:13:43 UTC, Shachar Shemesh wrote: It just seems like extra unneeded superfluous unnecessary redundancy. It is somewhat important because storing a slice to a static array is a big problem: int[] stored; void func(int[] s) { stored = s; } void test()

Re: Make int[12] convertible to int[]

2014-12-17 Thread bearophile via Digitalmars-d
Adam D. Ruppe: the compiler DOES allow this implicit conversion at times, which has caused my bugs before. We will hopefully have some simplified kind of tracking of memory ownership to remove this problem. Bye, bearophile