On Fri, 2010-02-26 at 11:22 +0100, Abderrahim Kitouni wrote:
> hi,
> 
> 2010/2/26, Sam Wilson <tecywiz...@hotmail.com>:
> > Hey!
> >
> > I am just wondering if there is any syntactic sugar for shortening the
> > following code segment
> >
> > [code]
> > Element? nsource = ElementFactory.make("filesrc", "file-source");
> > if (nsource == null) { printError(); return; }
> > Element source = (Element)nsource;
> > [/code]
> I beleive that last line can become
> var source = (!) nsource;
> and I even think the intended behaviour (right now it's a TODO in vala
> source) of non-null cast is to be like this (if the var is null, log a
> critical warning and return), so at some point, you should be able to
> write this in one line (assuming you beleive the returned value should
> be non null for your aguments).
> 
> HTH,
> Abderrahim
> 

That is exactly what I was looking for!  Thanks :)

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to