Re: [Vala] Passing Ownership Help

2011-07-09 Thread Luca Bruno
On Sun, Jul 10, 2011 at 02:36:23AM +0900, Peter Cartwright wrote: > Hi guys, > > I am trying to understand how a function can take ownership of an object > passed into it. According to documentation it should be like below: > > MyList.add (owned Person p) { > _first = (owned) p; > } > > Person

[Vala] Passing Ownership Help

2011-07-09 Thread Peter Cartwright
Hi guys, I am trying to understand how a function can take ownership of an object passed into it. According to documentation it should be like below: MyList.add (owned Person p) { _first = (owned) p; } Person p = new Person ("Bobby"); List.add (p); stdout.printf ("%u\n", p.ref_count); But whe

Re: [Vala] Problems retrieving binary data from a sqlite3 database BLOB column

2011-07-09 Thread Jens Georg
On So, 2011-06-26 at 00:24 +0200, IƱigo Serna wrote: > Hi, > > I have problems retrieving binary data from a sqlite3 DB. > > One of the columns of the database (f.e., number 3) is a BLOB with png images. > > Using FileUtils.set_data("test.png", (uint8[]) smtm.column_blob(3)); > writes a 8-bytes

Re: [Vala] Is there a way to use the Vala coroutines to achieve the same effect as in the following Python snippet (coroutines returning partial results in an iterator-like way) ?

2011-07-09 Thread Luca Bruno
On Sat, Jul 09, 2011 at 11:22:41AM +0200, Serge Hulne wrote: > Brilliant, > > Thank you very much indeed, Luca ! > > Please note that my note was merely an acknowledgement that, as a Vala > newbie, I tried successively two naive implementations, knew enough to > suspect intuitively one could push

Re: [Vala] Is there a way to use the Vala coroutines to achieve the same effect as in the following Python snippet (coroutines returning partial results in an iterator-like way) ?

2011-07-09 Thread Serge Hulne
Brilliant, Thank you very much indeed, Luca ! Please note that my note was merely an acknowledgement that, as a Vala newbie, I tried successively two naive implementations, knew enough to suspect intuitively one could push it a step further, but lacked the know-how required to succeed in implemen

[Vala] Fwd: Question about a basic coroutine example

2011-07-09 Thread Luca Dionisi
-- Forwarded message -- From: Luca Dionisi Date: Sat, Jul 9, 2011 at 9:55 AM Subject: Re: [Vala] Question about a basic coroutine example To: Nor Jaidi Tuah On Sat, Jul 9, 2011 at 1:36 AM, Nor Jaidi Tuah wrote: > >> Once again, if you really need a cooperative multitasking in y

Re: [Vala] Is there a way to use the Vala coroutines to achieve the same effect as in the following Python snippet (coroutines returning partial results in an iterator-like way) ?

2011-07-09 Thread Luca Bruno
On Sat, Jul 09, 2011 at 09:01:42AM +0200, Serge Hulne wrote: > In the meantime, tried the "scanner" example (my last entry in the Vala > maling list with an iterator. > > Of course, since the vala iterator returns one item at a time it does the > trick. I've just published a generators example ex

Re: [Vala] Is there a way to use the Vala coroutines to achieve the same effect as in the following Python snippet (coroutines returning partial results in an iterator-like way) ?

2011-07-09 Thread Serge Hulne
In the meantime, tried the "scanner" example (my last entry in the Vala maling list with an iterator. Of course, since the vala iterator returns one item at a time it does the trick. The problem, on the second degree is that the vala iterator needs know in advance the value of the next element t