[Vala] request to add another example to Projects/Vala/ListExample

2016-03-20 Thread MohanR
Hi, I'm a beginner in vala. I would like to add the following example to this wiki link to make other beginners understand important thing about List. https://wiki.gnome.org/Projects/Vala/ListSample int main(string[] args) { List mylist = new List(); mylist.append("hi");

Re: [Vala] request to add another example to Projects/Vala/ListExample

2016-03-20 Thread MohanR
get copied. However with > List they would be equal. It would be better if you > could reword that comment about pointing to the ownership of the List > elements > > On Fri, Mar 18, 2016 at 8:26 PM, MohanR <mohan...@gmail.com> wrote: > > Hi, > > > > I'm a beginner in

Re: [Vala] request to add another example to Projects/Vala/ListExample

2016-03-19 Thread MohanR
ist they get copied. However with > List they would be equal. It would be better if you > could reword that comment about pointing to the ownership of the List > elements > > On Fri, Mar 18, 2016 at 8:26 PM, MohanR <mohan...@gmail.com> wrote: > > Hi, > > > > I

Re: [Vala] disable free at block end

2016-03-11 Thread MohanR
On Thu, 2016-03-10 at 13:22 -0500, Guillaume Poirier-Morency wrote: > You should read directly in the memory allocated for the 'Remote' > struct instead of using a temporary buffer. I think it's correct to > cast it to uint8[]. > > socket.receive ((uint8[]) remote); > remotes.append_val (remote);

Re: [Vala] disable free at block end

2016-03-10 Thread MohanR
On Thu, 2016-03-10 at 13:22 -0500, Guillaume Poirier-Morency wrote: > Unless you are doing something very specific, use SocketService, it > has > a much simpler interface: > > http://valadoc.org/#!api=gio-2.0/GLib.SocketService > > The SocketConnection is an IOStream, so you have access to >

[Vala] disable free at block end

2016-03-10 Thread MohanR
Hi, May be a i'm wrong, but here is my issue, namespace test { struct Remote { uint16 id; uint32 ip; } class SocketReader: Object { Socket socket; Array remotes; public

Re: [Vala] returning async func from a callback

2015-01-26 Thread MohanR
On Mon, 2015-01-26 at 11:43 -0800, Mario Daniel Ruiz Saavedra wrote: What about setting the Cancellable as a default null parameter? Something like: public async book init(string[] args, Cancellable? cancellable = null) yes, cancellable will work perfectly as long as the caller catches the