Re: [Vala] Change in 0.23.1 for array ownership and .length parameter

2014-01-11 Thread Maciej Piechotka
On Thu, 2014-01-09 at 22:10 +0100, Luca Bruno wrote: > On Thu, Jan 9, 2014 at 9:58 PM, Tal Hadad > wrote: > > > > That would be a memory leak. > > No it wouldn't: > > If the "if" statement is false, then it should delete it in the end of the > > block. > > > > You might afraid the complicity of

Re: [Vala] Change in 0.23.1 for array ownership and .length parameter

2014-01-09 Thread Luca Bruno
On Thu, Jan 9, 2014 at 9:58 PM, Tal Hadad wrote: > > That would be a memory leak. > No it wouldn't: > If the "if" statement is false, then it should delete it in the end of the > block. > > You might afraid the complicity of valac calculation. > That could be resolved - using two C variables - on

Re: [Vala] Change in 0.23.1 for array ownership and .length parameter

2014-01-09 Thread Tal Hadad
ammer solve this(including me) problem by saving this variable in different unowned variable, but this is not intuitive(especially for a new language) and may raise many bugs. Tal Date: Thu, 9 Jan 2014 21:04:16 +0100 Subject: Re: [Vala] Change in 0.23.1 for array ownership and .length parameter

Re: [Vala] Change in 0.23.1 for array ownership and .length parameter

2014-01-09 Thread Luca Bruno
t; statement, just like I suggest. > > Tal > > > Date: Tue, 7 Jan 2014 09:24:40 +0100 > > From: lethalma...@gmail.com > > To: vala-list@gnome.org > > Subject: Re: [Vala] Change in 0.23.1 for array ownership and .length > parameter > > > > On 07/01/2014

Re: [Vala] Change in 0.23.1 for array ownership and .length parameter

2014-01-09 Thread Tal Hadad
o: vala-list@gnome.org > Subject: Re: [Vala] Change in 0.23.1 for array ownership and .length > parameter > > On 07/01/2014 06:46, Tal Hadad wrote: > > This case trigger me a question I wanted to ask before. > > Why transforming ownership is nulling the original variable?

Re: [Vala] Change in 0.23.1 for array ownership and .length parameter

2014-01-07 Thread Luca Bruno
On 07/01/2014 06:46, Tal Hadad wrote: This case trigger me a question I wanted to ask before. Why transforming ownership is nulling the original variable? Instead of nulling, maybe just change variable to behave as unowned. You might say that there is a problem in my solution, like this code:

Re: [Vala] Change in 0.23.1 for array ownership and .length parameter

2014-01-07 Thread Jürg Billeter
Hi Tal, On Tue, 2014-01-07 at 07:46 +0200, Tal Hadad wrote: > The user might use "ar" varible later and it will crush he's application. > If he was lucky enough, he would realize that ar is null. > It's not easy to find that this line causing it. Risking dangling pointers is much worse than null

Re: [Vala] Change in 0.23.1 for array ownership and .length parameter

2014-01-06 Thread Tal Hadad
From: j...@yorba.org > To: vala-list@gnome.org > Subject: [Vala] Change in 0.23.1 for array ownership and .length parameter > > Just wanted to give everyone a head's-up about a change that appeared > in Vala 0.23. Previously you could do this in Vala: > > uint8[] ar =

[Vala] Change in 0.23.1 for array ownership and .length parameter

2014-01-06 Thread Jim Nelson
Just wanted to give everyone a head's-up about a change that appeared in Vala 0.23. Previously you could do this in Vala: uint8[] ar = new uint8[10]; // ... fill ar with interesting bytes ... process((owned) ar, ar.length); ... where process() takes an array and a length field (sometimes beca