Re: [Vala] Question about namespaces..

On Fri, 2010-01-08 at 16:06 +0100, Jiří Zárevúcky wrote:
I don't really know what "metaspace" is, but can't you just use static
methods, the same as with your namespace?

Anyway, in Vala, namespace is just a name prefix. It is nothing more and
never will be. It is there just to logically group related stuff. If you
need more, use classes with static members. :)

I actually meant metaobject.. metaspace is what you get when you combine
metaobject + namespace. 8D

That's exactly what I had done and it was working quite well. I just
thought MyApp.Plugin.current.some_task() looked more esthetically
pleasing.. However, had I choosen a better name,
MyApp.Plugin.get_current().some_task() looks good too.

BUT, after mulling over Jan's response a bit further, I see where I had
gone wrong. The namespace is still used to add/remove/select the
plugins, but tracking them is done in a quasi-reimplemented HashMap of
my own making. Now it's my_ordered_hash_variable.current.some_task() or
for anything outside of the Plugins namespace,
MyApp.Plugins.get_current(). (Duh! I hate missing the obvious)


Thanks Jan and Jiří!

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