Re: [Vala] Using 'as' for casting?

2009-08-24 Thread Sam Danielson
A third type of cast. There is a way to use generics to get covariant types wherever you want and do away with most 'as' dynamic casts. The effect is the same as static (Type) casts but you're either all right or all wrong for a class. I'm not sure if it's a good practice all the time but there

Re: [Vala] Why do regular reference types leak null?

2009-08-14 Thread Sam Danielson
direction. -Sam Danielson ___ Vala-list mailing list Vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list

Re: [Vala] Why do regular reference types leak null?

2009-08-14 Thread Sam Danielson
2009/8/14 Jiří Zárevúcky zarevucky.j...@gmail.com: On 08/14/2009 10:57 PM, Sam Danielson wrote: Perhaps I am misunderstanding the purpose of nullable types. The Vala tutorial explains, By default, Vala will make sure that all reference point to actual objects. As I understand, the whole point

[Vala] Why do regular reference types leak null?

2009-08-13 Thread Sam Danielson
. Will the type system be statically null-check aware, silently changing Foo? to Foo inside 'if (foo != null) {...}'? -Sam Danielson ___ Vala-list mailing list Vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list

[Vala] Trouble with array length in vala 0.7.4

2009-06-29 Thread Sam Danielson
}; public int[] aprop { get { return a; } } public int[] afunc () { return a; } } -Sam Danielson ___ Vala-list mailing list Vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list

Re: [Vala] Switch statement on GType.

2009-06-23 Thread Sam Danielson
Under Vala 0.6 the following worked. switch (tree_store.get_column_type (n)) { case typeof(string): ... break; } In Vala 0.7 it does not -- error: Integer or string expression expected. Should it actually be 'error: Integer or string literal expected.'? I was unclear.

[Vala] Switch statement on GType.

2009-06-20 Thread Sam Danielson
. Is this a bug or desired behavior? -Sam Danielson ___ Vala-list mailing list Vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list

Re: [Vala] Help with generating headers. Forward declaration?

2009-06-12 Thread Sam Danielson
On Fri, Jun 12, 2009 at 3:41 AM, qnullinterfl...@gmx.net wrote: Not only you have to add -H, but also the name of the .h file: valac ... -H foo.h ... maybe you also have to add the path for the .h file The -H option works. I omitted the argument to -H and that was causing my first source file

[Vala] Help with generating headers. Forward declaration?

2009-06-11 Thread Sam Danielson
I have a convenience library written in Vala so I need to generate headers. There are a few circular dependencies and adding the -H switch to valac causes something like this. libsqlpilot/flight.vala:8.10-8.17: error: The type name `Aircraft' could not be found public Aircraft?

Re: [Vala] parse a dhcpd.conf

2009-06-09 Thread Sam Danielson
Is there a mailing list for the dhcp server? Failing that look at the source of the dhcp server, specifically server/confparse.c at http://ftp.isc.org/isc/dhcp/ ___ Vala-list mailing list Vala-list@gnome.org

Re: [Vala] Error in allocating memory

2009-04-25 Thread Sam Danielson
I ran into something like this using the 6.1 compiler. Don't know if it exists in 7.*, nor did I see a bug that fit the description. It looks like an array length problem of which the only workaround I know is to use resize. External libs communicate size info separately but I would still expect

Re: [Vala] Extension Methods

2009-03-07 Thread Sam Danielson
are encouraged to hack the vapi's, which hurts standardization. All for the love of syntax sugar :). -Sam Danielson ___ Vala-list mailing list Vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list

Re: [Vala] Confused with constructors

2009-02-26 Thread Sam Danielson
Thanks for the reply. I found the thread you started in Nov. 2008 to be of some help too. http://mail.gnome.org/archives/vala-list/2008-November/msg00113.html On Wed, Feb 25, 2009 at 2:30 PM, Feng Yu rainwood...@gmail.com wrote: On Sun, Feb 22, 2009 at 2:02 PM, Sam Danielson samdaniel

Re: [Vala] vala gnome integration

2009-02-13 Thread Sam Danielson
As an aside, one minor quirk is that GLib translates to g_ and not g_lib_. I like the minimum 3 letter naming convention for namespaces but since GLib is special anyway it could just as well be called G. Maybe I missed some other reason for it being called GLib. -Sam

[Vala] Emacs setup for vala debugging with automake / subclassing Glib structs.

2009-01-15 Thread Sam Danielson
The error messages output from the Vala compiler with the --basedir option include the path relative to the basedir. GCC generates error messages containing only the filename. Emacs tracks the current directory in the build and gets confused by the full path names from the vala compiler so it is

[Vala] Error codes as values?

2009-01-06 Thread Sam Danielson
Given that many C libraries return integer error codes, is there a way to pass the return value into a throw new. How would I set up the errordomain in the vapi file so the enumeration codes match? Prefer this (doesn't actually work): code = Database.open(filename, out _db); if ( code != OK )

Re: [Vala] Thanks

2008-12-25 Thread Sam Danielson
That's the Christmas Spirit. To add my two cents, I have an application I wrote in C that I have been using for about six months. It's a mess and I did not use GObject save for interfacing with gtk. I've been trying to finish that last mile, making it useful for my coworkers, but I have found