Re: [Vala] Extension Methods

2009-03-20 Thread Didier Ptitjes
Hi, Frederik wrote: These 'categories' are even named, so you can group these additional methods thematically. If Vala considers such a feature I would propose the following syntax: public class string category SpellChecking { // ... } public class Gtk.Widget category GLFunctionality

Re: [Vala] Extension Methods

2009-03-19 Thread Feng Yu
What about this: public extend class Gtk.Widget { public bool set_gl_capability (GdkGl.Config glconfig, Gdk.GlContext? share_list, bool direct, int render_type) { // do stuff. } } AKA, when vala encounters the extend keyword, instead of panicing duplicated class declarations, it

Re: [Vala] Extension Methods

2009-03-19 Thread Frederik
Feng Yu wrote: What about this: public extend class Gtk.Widget { public bool set_gl_capability (GdkGl.Config glconfig, Gdk.GlContext? share_list, bool direct, int render_type) { // do stuff. } } AKA, when vala encounters the extend keyword, instead of panicing

Re: [Vala] Extension Methods

2009-03-07 Thread Sam Danielson
2009/3/6 Uwe Strempel u.strem...@googlemail.com: Hi, yes you are right. C# 3.0 syntac for inner-type declaration is not the best. This syntax:        public int string.count_words() {                return this.split_set( .?).length;        } might be better. Thanks, regards Uwe That

Re: [Vala] Extension Methods

2009-03-06 Thread Uwe Strempel
Hi, yes you are right. C# 3.0 syntac for inner-type declaration is not the best. This syntax: public int string.count_words() { return this.split_set( .?).length; } might be better. Thanks, regards Uwe 2009/3/6 Didier Ptitjes ptit...@free.fr Hello Uwe, Uwe

[Vala] Extension Methods

2009-03-05 Thread Uwe Strempel
Hi, is there any feature like extension methods from c# 3.0 in vala supported. It would be a cool feature in vala and could allow to write better code. namespace ExtensionMethods { public static class MyExtensions { public static int WordCount(this String str) {