Re: [Vala] VAPI Question - Static Methods



There wouldn't have been any difference semantically if min and max were
instance methods. However both for historical reason and probably because
the final code is more clear, we kept them static methods.
For what concerns to_string(), it's because that's the convention among all
classes, not only int. It would have been very inconvenient to have it
static.


On Sat, Jan 18, 2014 at 1:24 AM, Steven Oliver <oliver steven gmail com>wrote:

How do you determine whether or not a method should be static when writing
vapis? Even if you just look at simple examples, like a max and min
functions for a type (eg. short, long, int) versus the clamp function or
the to_string function. The first two are static and second two are not.
What's the difference?

Steven N. Oliver
_______________________________________________
vala-devel-list mailing list
vala-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-devel-list




-- 
www.debian.org - The Universal Operating System


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]