Re: [Vala] [Async] why use .begin ?

2009-09-18 Thread Yu Feng
Please someone elaborates on .begin / .end in the tutorial. The async story is missing in it. - Yu On Fri, 2009-09-18 at 20:10 +0200, Jan Hudec wrote: > On Fri, Sep 18, 2009 at 19:52:59 +0200, JM wrote: > > What does .end() do? Are there any examples available? > > It's a syntax for the _finish

Re: [Vala] [Async] why use .begin ?

2009-09-18 Thread Jürg Billeter
On Sat, 2009-09-19 at 01:41 +0200, Michael 'Mickey' Lauer wrote: > > No, the call without .begin() is being deprecated. > > > > >From yestarday's discussion on IRC I understood it's not generally possible > > to collapse to synchronous call automagically. Doing it involves running > > a (recursive

Re: [Vala] [Async] why use .begin ?

2009-09-18 Thread Michael 'Mickey' Lauer
> No, the call without .begin() is being deprecated. > > >From yestarday's discussion on IRC I understood it's not generally possible > to collapse to synchronous call automagically. Doing it involves running > a (recursive) main loop until the callback is called, but this brings a lot > of proble

[Vala] [BUG] Cannot store delegate in a class.

2009-09-18 Thread Jan Hudec
Hello folks, Until recently, I could store a delegate in a class. It was incorrect in many cases because a destroy notify was not stored in the delegates. Now the destroy notify is stored, but for some reason fails to be stored in a class. What is worse, vala does not report any error and silentl

Re: [Vala] Strange error from glib-2.0.vapi

2009-09-18 Thread Enrique Ocaña González
On Sunday 05 April 2009 10:50:43 Michael B. Trausch wrote: > Another question I have where I am trying to figure out if I am doing > it wrong, or if there is a bug: > > glib-2.0.vapi:1229.2-1229.18: error: The value type `GLib.Pid` doesn't > declare a GValue set function > public struct Pi

[Vala] Disconnecting lambdas from signals.

2009-09-18 Thread Jan Hudec
Hi folks, Obvious use for lambdas is connecting them to signals, right? But how does one disconnect them? The tutorial suggests code like: t1.sig_1.connect((t, a) => { stdout.printf("%d\n", a); }); (where sig_1 is declared as "public signal void sig_1(int a);" Fine. Now say I n

Re: [Vala] [Async] why use .begin ?

2009-09-18 Thread Jan Hudec
On Fri, Sep 18, 2009 at 20:33:44 +0200, JM wrote: > Can you also say something about > > async_function.callback > > I've seen it in the dbus test, but I don't fully understand it yet. That's a delegate, of the SourceFunc type. If you use the bare yield statement, that is: yield; The

Re: [Vala] [Async] why use .begin ?

2009-09-18 Thread JM
Ah. ok. Can you also say something about async_function.callback I've seen it in the dbus test, but I don't fully understand it yet. Regards Jörn Am Freitag, den 18.09.2009, 20:10 +0200 schrieb Jan Hudec: > On Fri, Sep 18, 2009 at 19:52:59 +0200, JM wrote: > > What does .end() do? Are

Re: [Vala] Hi, Is Vala what I am looking for?

2009-09-18 Thread Michael B. Trausch
On Fri, 2009-09-18 at 08:54 -0400, Levi Bard wrote: > > It almost sounds to me like you want a C# compiler that targets real > > CPUs instead of targeting the CLI? You won't find that in Vala. > > Fortunately, mono already has this feature: http://www.mono-project.com/AOT > Kinda-sorta. AOT-co

Re: [Vala] [Async] why use .begin ?

2009-09-18 Thread Jan Hudec
On Fri, Sep 18, 2009 at 19:52:59 +0200, JM wrote: > What does .end() do? Are there any examples available? It's a syntax for the _finish function. Takes the AsyncResult and return the real result or throws an error (if the async function does). It's called like async_function.end(result) in

Re: [Vala] [Async] why use .begin ?

2009-09-18 Thread JM
Hello What does .end() do? Are there any examples available? Please also put some information to the tutorial. That would be great! Thanks Jörn > No, the call without .begin() is being deprecated. > > >From yestarday's discussion on IRC I understood it's not generally possible > to collapse to sy

Re: [Vala] [Async] why use .begin ?

2009-09-18 Thread Jan Hudec
On Fri, Sep 18, 2009 at 18:34:47 +0200, Michael 'Mickey' Lauer wrote: > On Friday 18 September 2009 18:18:33 JM wrote: > > Hi all > > A few days ago I edited the asynchronous stream reading example on the > > vala site to use the new async syntax. > > http://live.gnome.org/Vala/GIOSamples#head-a617

Re: [Vala] [Async] why use .begin ?

2009-09-18 Thread JM
Ok. Thanks! PS.: Can someone who knows the async stuff better than me write a few lines about .begin and .end to the vala tutorial? Regards, Jörn Am Freitag, den 18.09.2009, 18:34 +0200 schrieb Michael 'Mickey' Lauer: > On Friday 18 September 2009 18:18:33 JM wrote: > > Hi all > > A few days ago

Re: [Vala] [Async] why use .begin ?

2009-09-18 Thread Michael 'Mickey' Lauer
On Friday 18 September 2009 18:18:33 JM wrote: > Hi all > A few days ago I edited the asynchronous stream reading example on the > vala site to use the new async syntax. > http://live.gnome.org/Vala/GIOSamples#head-a6170c01121b9fe5825f431de73573b0 >84545741 > > After the release of vala-0.7.6 I rea

[Vala] [Async] why use .begin ?

2009-09-18 Thread JM
Hi all A few days ago I edited the asynchronous stream reading example on the vala site to use the new async syntax. http://live.gnome.org/Vala/GIOSamples#head-a6170c01121b9fe5825f431de73573b084545741 After the release of vala-0.7.6 I realized that other examples of the new syntax use '.begin()' t

Re: [Vala] gstreamer patch

2009-09-18 Thread Frederik
pancake wrote: > Defining default null values where possible. > > We can probably extend this behaviour in other VAPIs. 'gstreamer-*.vapi' is auto-generated like many other VAPI files for GObject libraries. So this information should go into the '.metadata' file. However, AFAIK there is no metada

[Vala] gstreamer patch

2009-09-18 Thread pancake
Defining default null values where possible. We can probably extend this behaviour in other VAPIs. diff --git a/vapi/gstreamer-0.10.vapi b/vapi/gstreamer-0.10.vapi index 3ab5f55..cde5739 100644 --- a/vapi/gstreamer-0.10.vapi +++ b/vapi/gstreamer-0.10.vapi @@ -357,7 +357,7 @@ namespace Gst { pu

Re: [Vala] Hi, Is Vala what I am looking for?

2009-09-18 Thread Levi Bard
> It almost sounds to me like you want a C# compiler that targets real > CPUs instead of targeting the CLI?  You won't find that in Vala. Fortunately, mono already has this feature: http://www.mono-project.com/AOT -- http://homes.eff.org/~barlow/EconomyOfIdeas.html http://www.dreamsongs.com/MobS

Re: [Vala] [ANNOUNCE] Vala 0.7.6 - Compiler for the GObject type system

2009-09-18 Thread jp0409
Already fixed? Great! Thanks! JP jp0...@jippii.fi wrote: > Hi, > > Thanks for the great release! Great progress!! > > Then the bad news ;-) The output of this one is 0. Is this correct? Seems to work now with Vala/master. Maybe it was the same bug as with my second example. Best regards,

Re: [Vala] [ANNOUNCE] Vala 0.7.6 - Compiler for the GObject type system

2009-09-18 Thread Frederik
jp0...@jippii.fi wrote: > Hi, > > Thanks for the great release! Great progress!! > > Then the bad news ;-) The output of this one is 0. Is this correct? Seems to work now with Vala/master. Maybe it was the same bug as with my second example. Best regards, Frederik

Re: [Vala] [ANNOUNCE] Vala 0.7.6 - Compiler for the GObject type system

2009-09-18 Thread Frederik
Jürg Billeter wrote: > This is correct, there is only one instance of the variable `a' and that > instance is captured by the closure. You can also change the value of > `a' inside the closure and this will affect the outer method as well as > there is only one instance of this variable. You're ri

Re: [Vala] [ANNOUNCE] Vala 0.7.6 - Compiler for the GObject type system

2009-09-18 Thread jp0409
Hi, Thanks for the great release! Great progress!! Then the bad news ;-) The output of this one is 0. Is this correct? JP --- delegate void Func (); Func goo () { int a = 42; Func f = () => stdout.printf ("%d\n", a); a = 43; return f; } void main () {

Re: [Vala] [ANNOUNCE] Vala 0.7.6 - Compiler for the GObject type system

2009-09-18 Thread Jürg Billeter
On Fri, 2009-09-18 at 10:11 +0200, Frederik wrote: > Great release! Thanks. > One question about closures: is it intentional that captured variables > change after the closure? For example: > > -- > delegate void Func (); > > void main () { >

Re: [Vala] [ANNOUNCE] Vala 0.7.6 - Compiler for the GObject type system

2009-09-18 Thread Frederik
Great release! One question about closures: is it intentional that captured variables change after the closure? For example: -- delegate void Func (); void main () { int a = 42; Func f = () => stdout.printf ("%d\n", a);