[Vala] Custom attributes/decorators



Hi Folks,

I'm curious about how people feel about adding a feature for custom
attributes/decorators that can be used for meta-programming.  If that
doesn't make sense, let me show an example of what I would like to
make possible.

Currently, I'm working on a follow up to GTask that is based on
high-velocity message passing and work-stealing[1].  One of the new
features is a service object[2] that can be used to write concurrent
services.  I'd like to be able to define custom code in the *.vapi
that allows for attributes to generate custom code.

public class MyService: Iris.Service {
        [Iris.Concurrent]
        public void do_something (MyRequest req) {
        }

        [Iris.Exclusive]
        public void change_state (MyState my_state) {
        }
}

With this, the attributes could generate the messages needed to
process those methods when allowed by the scheduler.  Of course this
could be used to do lots of other neat things like input validation
and what not.

Does this sound interesting to anyone?  Should I file an enhancement request?

More importantly, does anyone have an idea about where to look to
start implementing something like this.

[1] http://audidude.com/blog/?p=124
[2] http://audidude.com/blog/?p=150

-- Christian



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