[Vala] Contracts on lambdas

2010-03-26 Thread Tristin Celestin
Is it possible to write a lamba expression with a contract? This is what I try to do now, and I get a compiler error. Example: delegate void strict_increment (int value); ... int local_value = 0; strict_increment = (value) requires (value > 0) => { local_value += value; } _

Re: [Vala] Fail to generate C code for following vala code, is this a bug?

2010-03-26 Thread Jan Hudec
On Sat, Mar 27, 2010 at 03:57:26 +0800, PCMan wrote: > > So, the problem is that the function return values are falsely > > marked as unowned in the VAPI. I reported a bug for it at > > https://bugzilla.gnome.org/show_bug.cgi?id=614044 > > > >> However, with Vala, how can I make vala methods return

Re: [Vala] Fail to generate C code for following vala code, is this a bug?

2010-03-26 Thread PCMan
On Sat, Mar 27, 2010 at 3:06 AM, Julian Andres Klode wrote: > On Sat, Mar 27, 2010 at 02:37:37AM +0800, PCMan wrote: >> On Sat, Mar 27, 2010 at 12:17 AM, Julian Andres Klode >> wrote: >> > Well, than f_finish() should probably not be there in the Volume >> > interface; so I think that's a bug. >

Re: [Vala] Fail to generate C code for following vala code, is this a bug?

2010-03-26 Thread Julian Andres Klode
On Sat, Mar 27, 2010 at 02:37:37AM +0800, PCMan wrote: > On Sat, Mar 27, 2010 at 12:17 AM, Julian Andres Klode > wrote: > > Well, than f_finish() should probably not be there in the Volume > > interface; so I think that's a bug. > So how can I fix this? Ship with a custom glib vapi file and remov

Re: [Vala] Fail to generate C code for following vala code, is this a bug?

2010-03-26 Thread PCMan
On Sat, Mar 27, 2010 at 12:17 AM, Julian Andres Klode wrote: > On Fri, Mar 26, 2010 at 11:56:04PM +0800, PCMan wrote: >> Thanks for the fast reply. >> >> On Fri, Mar 26, 2010 at 6:45 PM, Julian Andres Klode >> wrote: >> > On Fri, Mar 26, 2010 at 11:07:20AM +0800, PCMan wrote: >> >> Hi list, >>

Re: [Vala] Fail to generate C code for following vala code, is this a bug?

2010-03-26 Thread Julian Andres Klode
On Fri, Mar 26, 2010 at 11:56:04PM +0800, PCMan wrote: > Thanks for the fast reply. > > On Fri, Mar 26, 2010 at 6:45 PM, Julian Andres Klode > wrote: > > On Fri, Mar 26, 2010 at 11:07:20AM +0800, PCMan wrote: > >> Hi list, > >> I tried to use Vala for the first time and the following code failed

Re: [Vala] Fail to generate C code for following vala code, is this a bug?

2010-03-26 Thread PCMan
Thanks for the fast reply. On Fri, Mar 26, 2010 at 6:45 PM, Julian Andres Klode wrote: > On Fri, Mar 26, 2010 at 11:07:20AM +0800, PCMan wrote: >> Hi list, >> I tried to use Vala for the first time and the following code failed >> to generate correct C code. >> Is this a bug of vala or what's wro

Re: [Vala] Fail to generate C code for following vala code, is this a bug?

2010-03-26 Thread Julian Andres Klode
On Fri, Mar 26, 2010 at 11:07:20AM +0800, PCMan wrote: > Hi list, > I tried to use Vala for the first time and the following code failed > to generate correct C code. > Is this a bug of vala or what's wrong with my code? (code is attached > to the end of this mail) You define *_finish which is alre

[Vala] Fail to generate C code for following vala code, is this a bug?

2010-03-26 Thread PCMan
Hi list, I tried to use Vala for the first time and the following code failed to generate correct C code. Is this a bug of vala or what's wrong with my code? (code is attached to the end of this mail) In addition, if I want to override a virtual function in a parent class with the prototype like t