[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.technology.gmt] Re: MOFScript: rules context type must be a metamodel type?

Hello

You can use the module context.  Meaning that something like
module::toto()

Should compile and work.


Regards

Tor


Yannick wrote:
Hi

I'm trying to write a "function" independant of a context type, is it
possible?


In fact I want to use a function inside a foreach statement not using a metamodel type (or context type) like this:

property num:Integer=3
num ->forEach(n){
	toto()
	// or n.toto() whatever
}

The problem is that I don't know what kind of context type I must use to
write the function toto().
I tried this:

toto(){
	// code: stdout ...
}

but it doesn't compile. I'd really like to write something like that so
that I can make smaller functions and thus easier to understand.


Could you help me please?